<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<!-- name = 受影响的原始类 -->
<type name="[Vendor]\[Module]\Xxx">
<arguments>
<!-- name = __construct函数的参数名 -->
<!-- text() = 指定所依赖的Proxy -->
<argument name="arg1" xsi:type="object">[Vendor]\[Module]\Xxxxx\Proxy</argument>
</arguments>
</type>
</config>
Magento2 di.xml 指定或重写某个类中构造函数入参所依赖Proxy
最新推荐文章于 2024-07-22 16:42:40 发布