[TYPO3-mvc] Set default controller by request

Bas van der Togt b.vandertogt at profinit.com
Wed Jan 9 19:12:54 CET 2013


Hello,

I have a plugin with 5 different controllers:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
	'Profinit.' . $_EXTKEY,
	'Menu',
	array(
		'Mainmenu' => 'list',
		'Subject' => 'list',
		'Question' => 'list',
		'Vcard' => 'download',
		'Contact' => 'form,create',
	),
	// non-cacheable actions
	array(
		'Mainmenu' => '',
		'Subject' => '',
		'Question' => '',
		'Vcard' => 'download',
		'Contact' => 'create',
	)
);

In this example Mainmenu is the default controller.
Is it possible to set the default controller by request?

For example:
tx_og_menu[mainmenu] > 0 : default controller is Mainmenu
tx_og_menu[subject] > 0 : default controller is Subject
tx_og_menu[Question] > 0 : default controller is Question

I want this to get rid of the controller parameter in my url's.
I know i can do this by making a seperate plugin for each controller but 
that's not what i want. I want clean url's :-)

Regards,
Bas


More information about the TYPO3-project-typo3v4mvc mailing list