I am not sure if extending a class should be done with the full namsespace
class XController extends \OxidEsales\Eshop\Application\Controller\FrontendController
``
or it should be extanded as
class XController extends FrontendController_parent
what i am sure about is that I get an Error whenever i use the _parent syntaxe
Is the documentation outdated or am i doing something work?
of course i am using this in metadata:
If you want to build your own class which acts just like some existing oxid classes, you extend your class the same way as the oxid classes do, so you would use:
class XController extends \OxidEsales\Eshop\Application\Controller\FrontendController
And you do NOT need an entry in “extends” for that, because no oxid class is changed, you just made your own controller. Your own classes used to be in the “files” array in Oxid 4.x, but with namespaces, this is no longer needed. But, in order to use your new frontend controller in a browser, you have to give it a key in the “controllers” array:
The “parent” syntax is used when you want to change the behaviour of an existing class, like if you want to add some functionality to articles or categories. Then you would use:
(No need to rename the class because it is namespaced).
So, if your goal is to change the behaviour of FrontendController for all existing controllers, this would seem the way to go, but unfortunately this is not possible, you can only change classes that are not extended by other classes, and are directly instantiated with “oxnew”.