Ok, never mind the question, I solved the problem. I forgot to call parent::beforeFilter when overriding beforeFilter in subclasses of appcontroller.
Apologies. ojonam On Feb 18, 11:15 am, ojonam <[email protected]> wrote: > Hello, > > I have an app which has two layouts, 'cake-generic' (the one that > comes with cake) and 'mysite'. I decided to use 'cake-generic' for my > admin interface (which is done through admin routing), and 'mysite' > for the rest. So in my app_controller.php file's beforeFilter > function, I have the following: > > function beforeFilter(){ > if(!isset($this->params['admin'])) { > $this->layout = 'mysite'; > } > > } > > Recently, I added the Auth component, and since, the above code has no > effect. I had to move it to the beforeRender function in order for it > to work. First off all, what could be the reasons for this? > > As an effect of the above, many of my ajax calls (autocomplete > features), have stopped functioning, because the 'mysite' layout > overrides the 'ajax' layout (as beforeRender function is called after > controller logic is taken care of). A fix to this problem (IMO dirty) > is to abusively call $this->render for each controller action where I > need ajax stuff. > > Would there be any neater solutions to these problems? > > Thanks, > ojonam -- 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
