[TYPO3-mvc] Extbase: How to define default controller and default action?

Peter Niederlag typo3-list at niekom.de
Fri Nov 4 15:27:08 CET 2011


Hello,

Am 02.11.2011 17:48, schrieb Bastian Waidelich:
> Roland wrote:
> 
> Hi Roland,
> 
>> how can i define the default controller and default action?
> 
> In Extbase, the first controller of a plugin is the default.
> The first action in the list of actions is the default action.
> 
> So, in order to change the default controller/action, simply adjust the
> Tx_Extbase_Utility_Extension::configurePlugin() code in the
> ext_localconf.php file of the extension.
> 
> If you need multiple defaults, I'd suggest to create multiple plugins.
> A plugin in Extbase is just a collection of controller & actions, so it
> is really "cheap".

but you will have the problem of different "namespaces" which make
passing of arguments a little harder. IIRC there are some options to
bypass this problem.

> If you only want to have one plugin and still want to change the default
> controller/action, you can use the switchableControllerAction option, as
> Daniel mentioned. But that comes at some cost (you can't use the
> skipDefaultArguments feature and you can't have custom flexforms for
> every view).

The flexform can be customized pretty much by its possibilities to
hide/show fields, for example based on the chosen
switchableControllerAction.

I "always" use the second way and only add separate plugins for really
separated functionality that is mostly isolated.

Another "more dirty" approach I have lately used is to forward to other
actions inside the default action, for example based on wether an
argument is set or not.

Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *


More information about the TYPO3-project-typo3v4mvc mailing list