you can also create custom layouts for error messages and then set
which one to use from the call to setFlash

in layouts create files like error.ctp, notice.ctp and success.ctp
looks like

<div class="error"><?php echo $content_for_layout ?></div>


then you can call

$this->Session->setFlash('The Report could not be saved. Please, try
again.', 'error');

to use the error template

or

$this->Session->setFlash('The Report could ] be saved.', 'success');

hth

sam d

On Jan 24, 2008 5:10 AM, Sebastian <[EMAIL PROTECTED]> wrote:
>
> Hey,
>
> it seems like before 1.2 you were able to send errorMessage from the
> controller to the view by simply setting:
>
> $this->set('errorMessage', 'There was an error');
>
> This message was then automatically rendered with the appropriate css
> class from cakePHP's default css file at the top of the page like a
> flash message.
>
> However, in 1.2 this doesn't work anymore :-( The only way I get to
> output error messages is by:
>
> $this->Session->setFlash('There was an error!');
> $this->render();
> $this->exit();
>
> My problem now is, that all these flash messages are rendered with the
> same css class (same background, same font color), which makes it hard
> to differentiate between an information and an error flash message.
>
> Is there any way to bring back the traditional way to output error
> messages? If not, is there a way to define css classes for a flash
> message?
>
>
> Regards,
>
> Sebastian
>
> >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~---------~--~----~------------~-------~--~----~
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