Sunday, October 3, 2010

Re: setting a layout for all cakeErrors

yes, it's true m8...i faaiil...actually u will need in all functions change this...

i have this in AppError

{{{

function error404($params)
{
$this->controller->layout = "error_default";
$this->controller->set("title_for_layout", __("Error 404", true));
parent::error404($params);
}

}}}
--
Tilen Majerle


2010/10/3 calzone <calzone@gmail.com>
I've tried this and it makes no difference.  The only time it makes a
difference is if I create actual custom error views and put them
inside /app/views/errors -- otherwise it just gets ignored.


On Oct 3, 2:55 am, Tilen Majerle <tilen.maje...@gmail.com> wrote:
> ok then do this in AppError
>
> {{{
>
>  function __construct($method, $messages)
> {
> parent::__construct($method, $messages);
>  $this->controller->layout = "layoutname";
>
> }
> }}}
>
> --
> Tilen Majerlehttp://majerle.eu
>
> 2010/10/3 calzone <calz...@gmail.com>
>
>
>
> > I don't want to change the layout for the whole site.  I just want to
> > change the layout for all errors.
>
> > On Oct 3, 2:46 am, Tilen Majerle <tilen.maje...@gmail.com> wrote:
> > > u can set it in AppController
>
> > > {{{
>
> > > function __construct()
> > > {
> > >    parent::__construct();
>
> > >    $this->layout = "yourlayout";
>
> > > }
> > > }}}
>
> > > --
> > > Tilen Majerlehttp://majerle.eu
>
> > > 2010/10/3 calzone <calz...@gmail.com>
>
> > > > I would like all cakeErrors to use the same layout, and I want that
> > > > layout to be something other than the default layout.
>
> > > > The only way I could see to accomplish this required creating app/
> > > > app_error.php and then rewriting every single error function and every
> > > > single error.ctp file and being sure to set the layout for each.
>
> > > > Is there a DRYer way to accomplish this?
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>
> > <cake-php%2Bunsubscr...@googlegroups.c om>For more options, visit this
> > group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

No comments: