You are right! the layout that I talked about is found in a theme not
in the master theme ( app/view/layouts ) so as a solution I may add it
to the master theme and then I need not to add it to other themes
because Cake will search for it in the master theme if it is not found
in the current theme.

On Jul 22, 6:18 pm, red <mbu...@gmail.com> wrote:
> According to the documentation:http://book.cakephp.org/view/1093/Themes
>
> "If a view file can't be found in the theme, CakePHP will try to
> locate the view file in the /app/views/ folder. This way, you can
> create master view files and simply override them on a case-by-case
> basis within your theme folder."
>
> So it looks, that you just need to create in view for session-flash
> with default markup and put it properly in /app/views/ folder
> structure and this should work.
>
> On 22 Lip, 12:55, saidbakr <said....@gmail.com> wrote:
>
> > Could I understand that there is no any way by which the controller
> > able to investigate about the existence of a layout or view in the
> > theme?
>
> > On Jul 22, 5:57 am, "Dr. Loboto" <drlob...@gmail.com> wrote:
>
> > > 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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to