[TYPO3-ect] Report: Expandable controller - praxis

Fabien Udriot fudriot at omic.ch
Sun Sep 9 22:36:15 CEST 2007


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


Elmar Hinz a écrit :
> Hello,
> 
> yesterday I had the first opportunity to test the expandable controller
> feature of lib. To remember: It's a way to register an additional
> collection of action methods to an existing controller class, either from
> within the same extension of from a foreign one.
> 
> My current extension has a single plugin controller class with already many,
> many actions. No I needed to extend the functionality by another table and
> form. Because the main controller is already very large I decided to
> encapsulate the new set of actions into a separate class. First praxis test
> of the expandable controller.
> 
> It didn't run out of the box and I started to debug. It turned out that
> additional controller class needs to be included before calling it by the
> main controller. Well, that may sound logical, but I didn't. There was no
> error message, the registered controller simply was ignored. That made
> debugging difficult. The smart soulution would be to autoinclude the
> registered controllers in the main controller. I need to file a bug report.
> 
> I included the additional controller in ext_localconf.php. Now everything is
> running well. It really seems to be a very smart solution, comparing
> projects in the past, where a needed to overwrite large switch-case
> constructs in different layer, each time for every extension of the
> extension.
> 
> Have a nice day
> 
> Elmar
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


More information about the TYPO3-team-extension-coordination mailing list