Try this:

controller:

$this->Session->setFlash('Edited successfully', 'custom_flash', array('class' 
=> 'success'));


views/elements/custom_flash.ctp

<div <?php echo isset($class) ? 'class="' . $class . '"' :  NULL; ?>>
  <p>
    <?php echo isset($message) ? $message :  NULL; ?>
  </p>
</div>


css:

.success { 
background-color: red;
}



Andras Kende
http://www.kende.com



On Aug 18, 2010, at 4:37 AM, Petter Andreas Strøm wrote:

> Im trying to create custom designs for setFlash messages. I've seen
> sevral tutuorials for this, like
> http://tech.rytis.net/2008/8/27/discover-layouts-for-setflash-method-in-cakephp
> , but none of them seems to work for me. I've installed cake 1.3 and
> it seems like it's looking for a element view instead of a layout
> which i specify in the second argument in the setFlash. Anybody know
> why? Is there any place to set where to look for the layouts for such
> messages?
> 
> 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 [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

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