Re: How could controller inform about layout or view existing?
Just create flsah for every theme and keep default markup for those
you do not need special.
On Jul 22, 5:19 am, saidbakr <said....@gmail.com> wrote:
> Hi,
>
> I use themes in my application, so there is multiple layouts and views
> for each controller could be handled. For one of the themes used, I
> created a layout called "flash" which is dedicated for displaying
> flash messages, so in the controller I used the following line of
> code:
> $this->Session->setFlash('The message to user','flsah');
>
> However, In another theme I don't need to format the flash message
> using the flash layout regarded before, so I don't create flash.ctp in
> the layout folder of that theme. Of course, when using the other
> theme, an error is returned tells about missing layout.
>
> My qestion is: How could I set some logic in the controller which is
> able to check if the flash layout is existing in the theme used or not
> and then assign its value - or name - in a variable to be passed in
> setFlash method as follows:
>
> $flasLayoutName = null;
> /* pseudo code start */
> if there is layout called flash in the current theme
> /* end pseudo code */
> $flashLayoutName = 'flash';
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home