Monday, January 31, 2011

Re: SecondController extends FirstController extends AppController: not supported? --psybear

Yes this is true, cakephp check if parent controller of 'SomeController' is 'AppController' but in your case this is 'XController'


btw: for your applications probably more than 80% did the community...u 've made here probably 1000 noob's questions....
--
Lep pozdrav, Tilen Majerle



2011/1/31 psybear83 <psybear83@gmail.com>
Hey everybody

I'm refactoring an application with some controllers and wanted to
"divide" them into a group X (that needs some components) and a group
Y that needs some other components. My idea:

class AppController {
 var $components = array('Html', 'Form');
}

class XController extends AppController {
 var $components = array('X1', 'X2');
}

class YController extends AppController {
 var $components = array('Y1', 'Y2');
}

Now every other controller should inherit from XController or from
YController like this:

class SomeXController extends XController {
 var $components = array('Bla');
}

I expected XController now to have loaded the following components:
Html, Form, X1, X2, and Bla. But sadly it doesn't have all of them! It
seems CakePHP doesn't allow controller inheritance over more than only
1 level. Is this true? Is there any known work-around?

Thanks a lot for help
Josh

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: