<?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="Magento\Customer\Model\Resource\Visitor">
<!-- name = plugin name, 全局唯一 -->
<!-- sortOrder = 运行顺序 -->
<!-- disabled = 是否关闭plugin -->
<plugin name="catalogLog"
type="Magento\Catalog\Model\Plugin\Log"
sortOrder="1"
disabled="true" />
</type>
</config>
Magento2 di.xml 声明plugin,用于修改目标类若干个method的入参或者返回结果
最新推荐文章于 2024-07-01 11:24:18 发布