[TYPO3-dev] XCLASS conflict examples

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Sun Feb 12 17:55:49 CET 2006


Michael Scharkow schrieb:
> In my prototype there is a little more magic going on because you really
> only add methods by subclassing the controller and registering the method:
> 
> class tt_news_pi1 extends fe_controller{
>     $this->register = array('index','singleview','latest','search');
>     function index(){
>         return 'foo';
>     }
>     function singleview(){
>         return 'bar';
>     }
>     ...
> }
> 
> myplugin = new tt_news_pi1;
> myplugin->main();
> 

Now the same with controller objects instead of functions:

class tt_news_pi1 extends fe_controller{
    $this->registerControllers = array(
  'index' => 'tt_news_pi1_index_controller',
  'single' => 'tt_news_pi1_single_controller',
    );
}

class tt_news_pi1_index_controller extends fe_controller{
   function main(....){

   }
}

class tt_news_pi1_single_controller extends fe_controller{
   function main(....){

   }
}

At this point the question is, if class tt_news_pi1 can't completly be replaced
by using a service to register classes for actions. May that is what Bernhard
wanted to point out.

/el









More information about the TYPO3-dev mailing list