문제

I want to create preference for this file Magento\Customer\Model\Metadata\Form\File but its not working so please give some solution for this problem how to solve it

di.xml code

도움이 되었습니까?

해결책

Your code looks correct. And if you instantiate the Magento\Customer\Model\Metadata\Form\File you should get an instance of your own class.
But maybe it does not work for you because you are not using directly the class Magento\Customer\Model\Metadata\Form\File.
I see that there is another class Magento\Customer\Model\Metadata\Form\Image that extends the Magento\Customer\Model\Metadata\Form\File. Maybe your code uses this Image class and not the File class. If this is the case you need to create a preference for the image class to work because the Image class still extends the original File class and not your new clsss.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top