[TYPO3-ect] Report: Expandable controller - praxis
Philip Almeida
philip.almeida at gmail.com
Fri Sep 7 11:33:50 CEST 2007
I think I had a similar problem trying to call a new controler from parent
controller, manage to get it all working by sending $this->configurations
and $this->controller->configurations that were not being recognized in
child controller class.
PARENT CONTROLER METHOD
------------------
function _callChildControllerActions($data) {
$pipe = tx_div::makeInstance('tx_spe_controllers_childController');
switch($data['action']){
case 'delete':
return
$pipe->_buildChildControllerActionDelete($data,$this->configurations,$this->controller->configurations);
case 'update':
return
$pipe->_buildChildControllerActionUpdate($data,$this->configurations,$this->controller->configurations);
default:
return
$pipe->_buildChildControllerAction($data,$this->configurations,$this->controller->configurations);
}
}
Parent controller call methods _buildPpvActionDelete,
_buildPpvActionUpdate and _buildPpvAction from child.
Regards,
philip
On 9/7/07, Elmar Hinz <elmar07 at googlemail.com> wrote:
>
> 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
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> TYPO3-team-extension-coordination mailing list
> TYPO3-team-extension-coordination at lists.netfielders.de
>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-extension-coordination
>
--
-- -- -- -- -- -- -- -- -- -- -- -- --
Philip de Oliveira de Almeida
Tel. 966 356 008
More information about the TYPO3-team-extension-coordination
mailing list