[TYPO3-mvc] RFC: Extensible Controllers
Mathias Gisch
mathiasgisch at googlemail.com
Sun Aug 9 15:00:59 CEST 2009
Hi Sebastian,
I am not sure, but would'nt you reach the same result by adding the
new actions to the TypoScript-Template under tt_content.list.20.
{$EXTKEY}.switchableControllerActions in your ext_typoscript_setup.txt?
Best, Mathias
> Hi folks,
>
> Currently the controllers define their actions through dedicated
> functions: indexAction(), showAction(), editAction() etc. Now if you
> want to add actions from "outside" the only possibility is XCLASSING
> the
> controller.
>
> It would be great if there was a cleaner way for extending
> controllers.
>
> Here's an example with my proposal:
> In a blog extension ('ablogextension') there's a controller Post with
> the actions index and show und compose (therefore it has the functions
> indexAction(), showAction() and composeAction() ).
>
> Now there's a second extension ('editposts') that wants to add actions
> to the Post Controller.
>
> In the ext_localconf.php of the new extension:
>
> $foreignExtKey = 'ablogextension';
> Tx_Extbase_Utility_Plugin::addForeignAction(
> $_EXTKEY,
> $foreignExtKey,
> 'Post'
> 'Tx_Editposts_Controller_Post'
> )
>
> Now if an action is called which is not available in the original Post
> controller then Extbase looks up Tx_Editposts_Controller_Post. It
> could
> contain an editAction() for example. It also contains the Fluid
> template
> for that new action.
>
> The advantage to XCLASS is of course that a controller can be extended
> multiple times and add different actions every time.
>
> I hope you get the point - what do you think?
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list