문제

How can i override this path: vendor/magento/framework/View/Element/Html/Select.php

with my custom module file?

도움이 되었습니까?

해결책

Your_VendorName\Your_ModuleName\etc\di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <preference for="Magento\Framework\View\Element\Html\Select" type="Your_VendorName\Your_ModuleName\Model\Framework\View\Element\Html\Select" />
</config>

다른 팁

Try overriding the class using a preference in your di.xml file like

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\View\Element\Html\Select" type="Your_Vendor\Your_Module\Your_Class_Type\Your_Class" />
</config>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top