True that on the admin = 1, my bad.

What version you using? I stumbled across the route layout assignment a
couple weeks back, seemed strange at first, but it def works with the
latest.

Anyways... 



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Mech7
Sent: Sunday, 2 March 2008 1:20 p.m.
To: Cake PHP
Subject: Re: Set layout for admin home?


Thx the layout var is available in the view.. i did not know that..
the others dont work putting it in the array of the route settings...
also the admin = 1 won't work as it will see that there is no
admin_page function.

On Mar 1, 10:38 pm, "websta*" <[EMAIL PROTECTED]>
wrote:
> Thro this in your route along with the beforeFilter condition or similar
>
> Router::connect('/admin', array( 'controller' => 'pages', 'action' =>
> 'display', 'home', 'admin'=>1, 'prefix'=>'admin'));
>
> Or if you just want to force the layout on that page in particular without
> setting it as an actual admin route:
>
> In your view: $this->layout = 'your_layout_here';
>
> Or in the route: Router::connect('/admin', array( 'controller' => 'pages',
> 'action' =>  'display', 'admin_home', 'layout'=>'your_layout_here'));
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf
>
> Of citrus
> Sent: Sunday, 2 March 2008 8:27 a.m.
> To: Cake PHP
> Subject: Re: Set layout for admin home?
>
> Try using strpos to check for the availability of the prefix admin_ in
> $this->action.
>
> Hope it might help.
>
> On Mar 1, 7:03 pm, Mech7 <[EMAIL PROTECTED]> wrote:
> > Well i specify which layout to use in the beforeFilter function in
> > app_controller..
>
> >         public function beforeFilter()
> >         {
> >                 // Set the folder for default theme
> >                 $this->theme = 'default';
>
> >                 if (isset($this->params['admin'])) {
> >                         // Set the default layout
> >                         $this->layout = 'admin_default';
> >                 } else {
> >                         $this->layout = 'default';
> >                 }
>
> >         }
>
> > Only the problem is that there is no $this->params['admin'] being set
> > on the admin home.
>
> > On Mar 1, 7:47 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > Not enough info. You might want to post how you're specifying your
admin
> layout.
>
> > > On Sat, Mar 1, 2008 at 8:23 AM, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > >  I am setting a page for admin home.. like:
>
> > > >  Router::connect('/admin', array( 'controller' => 'pages', 'action'
=>
> > > >  'display', 'admin_home'));
>
> > > >  only it has the default layout.. and i specified a admin layout in
my
> > > >  app_controller for every admin request.. is there a way to set the
> > > >  layout in the view itself ?
>
> __________ NOD32 2913 (20080301) Information __________
>
> This message was checked by NOD32 antivirus system.http://www.eset.com



__________ NOD32 2913 (20080301) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to