Friday, January 1, 2010

Re: $this->Session->setFlash();

Hi Dave

Here's how you can do it:

$this->Session->setFlash(__('Your message.', true), true, array
('class' => 'yourClass'));

On Jan 2, 2:35 am, "Dave" <make.cake.b...@gmail.com> wrote:
> I was wondering is there a way to add a class to the session from the
> controller?
>
> The setflash as far as i can see is used for alerting user after a save
> attempt so
>
> $this->Session->setFlash(__('Information Updated.', true));
>
> or
>
> $this->Session->setFlash(__('Error! Please try again.', true));
>
> So the idea would be for the success message add a class so the message text
> is green if failed text is red.
>
> Any way this can be done?
>
> Dave

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: