Page 1 of 1

extend all src files in one way

Posted: 21 Jun 2022, 12:56
by ahmed31916
Hello Aimeos,

Can I copy all the files in the path:"vendor\aimeos\ai-client-html\src\Client"
and paste it to the "packages\myExt\src\Client" of the extension, so the templates will relay on it, ineasted of the vendor?

If it succeed, it will give us a lot of comfort.

Re: extend all src files in one way

Posted: 24 Jun 2022, 09:42
by aimeos
No, that won't work that way because then, there will be two files with the same name and composer may choose the wrong one leading to hard to find problems in your code base. Furthermore, you won't be able to get any bugfixes for that code because you've overwritten the complete file.

Instead, you should extend from the class you want the change, overwrite only the method you want to change and configure the new class name to be used instead.