-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdi.xml
36 lines (33 loc) · 1.78 KB
/
di.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0"?>
<!-- @author Artemii Karkusha -->
<!-- @copyright Copyright (c) (https://www.linkedin.com/in/artemiy-karkusha/) -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="SimpleClassSecondWithCustomParam" type="ArtemiiKarkusha\AdobeCommercePreparingToCertification\Model\SimpleClassSecond">
<arguments>
<argument name="stringParam" xsi:type="string">CustomParam</argument>
</arguments>
</virtualType>
<!--2.4-->
<type name="ArtemiiKarkusha\AdobeCommercePreparingToCertification\Model\ExampleHowDiIsUsed">
<arguments>
<!-- Pass simple string -->
<argument name="stringParam" xsi:type="string">someStringValueForFrontend</argument>
<argument name="arrayParam" xsi:type="array">
<!-- First element is value of constant -->
<item name="firstElem" xsi:type="string">ExampleHowDIUsing-arrayParam-firstElem</item>
<!-- Pass object -->
<item name="objectValue" xsi:type="object">ArtemiiKarkusha\AdobeCommercePreparingToCertification\Model\SimpleClassSecond</item>
<!-- Pass virtual object -->
<item name="SimpleClassSecondWithCustomParam" xsi:type="object">SimpleClassSecondWithCustomParam</item>
</argument>
</arguments>
</type>
<type name="ArtemiiKarkusha\AdobeCommercePreparingToCertification\Controller\ActionsResults\Layout">
<arguments>
<argument name="handles" xsi:type="array">
<item name="exampleInjectedHandleName" xsi:type="string">example_result_layout_page</item>
</argument>
</arguments>
</type>
</config>