On Wed, August 18, 2010 4:23 pm, Andras Kende wrote:
> 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;
> }


you could also use the default flash element which can handle being given
a class

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


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


-- 
Mike Karthauser
Managing Director - Brightstorm Ltd

Email: mi...@brightstorm.co.uk
Web: http://www.brightstorm.co.uk
Tel:  07939 252144 (mobile)
Fax: 0870 1320560

Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

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