[TYPO3-dev] Extending existing controller
Charles Brunet
charles.fmj at gmail.com
Thu Dec 4 13:59:20 CET 2014
Hello,
How can I add either a new Controller or a new action to an existing
controller, to an existing plugin provided by another extension?
I know I could simply subclass the existing controller, and replace the
value of the class name in config.tx_extbase.objects. However, doing like
this, only one extension can extend an existing plugin.
To be more specific, I want to extend the news extension by adding a new
action to it. I also use the roq_newsevent extension, that already extends
the news extension. However, I don't like the was it does it, because it
replaces the Domain and Controller classes by subclassing them, preventing
me to do the same. I could simply subclass the Controller provided by
row_newsevent, but I'd like my extension to work with or without
roq_newsevent.
It is easy to add a new action to the interface using the provided
configuration variable:
$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['switchableControllerActions']['newItems']['News->byFobar']
= 'A fobar action';
In that array, 'News' is the name of the Controller. I could provide my own
Controller, but in that case, how would it find it in the right php file,
without disturbing other configured controllers?
This is where I am stuck now. Is there a mechanism of extbase I am not
aware that could help me, or is it a limitation of the framework?
Thank you for your help,
*Charles Brunet, B. Ing.*
Webmestre.
Étudiant au doctorat, génie électrique, Université Laval.
More information about the TYPO3-dev
mailing list