[TYPO3-ect] Report: Expandable controller - praxis
Elmar Hinz
elmar07 at googlemail.com
Sun Sep 9 23:06:34 CEST 2007
Fabien Udriot wrote:
> Hi,
>
> As I had to cope with the similar issue, I would be interested to see your
> code-solution.
>
> Here is the way I found to call an "external" controller :
>
> // initialize the object according to the class name.
> $subscriptionClassName =
> tx_div::makeInstanceClassName('tx_ecosubscription_controllers_form');
> $subscription = new $subscriptionClassName();
>
> // get the Typoscript
> $TSconfig = $GLOBALS['TSFE']->tmpl->setup;
>
> // set the view variable in the actual controller
> $view['subscription'] =
> $subscription->main(null,$TSconfig['plugin.']['tx_ecosubscription.'
['controller.']['form.']['configurations.']);
>
> best regards,
>
> Fabien
>
>
Hello Philip, Fabien,
what you describe is the call to a full subcontroller like shown in the
result browser.
http://upload.wikimedia.org/wikipedia/commons/4/4a/Pac-schema.png
"The expandable controller" is not a call to a subcontroller, but simply
adding more action functions for the same controller.
<?php
2 if (!defined ('TYPO3_MODE')) die ('Access denied.');
...
Register the expanding controller class tx_archive_filesController
for the class tx_archive_controller:
6
7 if (TYPO3_MODE == 'FE'){
8 $TYPO3_CONF_VARS['CONTROLLERS']['tx_archive_controller'
['tx_archive_filesController'] = 1;
9
...
Include class manually because autoinclusion is still missing:
15 require_once(t3lib_extMgm::extPath('div') . 'class.tx_div.php');
16
17 tx_div::load('tx_lib_controller');
18 tx_div::load('tx_archive_controller');
19 tx_div::load('tx_archive_filesController');
...
39
40 }
41 ?>
More information about the TYPO3-team-extension-coordination
mailing list