You can create your own helper that extends the session helper.

On May 31, 1:07 am, Abhimanyu Grover <[EMAIL PROTECTED]> wrote:
> Great, figured it out now :) Thanks
>
> Even though my problem is solved, I'm still looking a way to extend
> helper functions like I said.
>
> On May 31, 3:59 am, francky06l <[EMAIL PROTECTED]> wrote:
>
> > Well, in the Session->setFlash, you can pass a layout for your
> > message, that can solve your CSS issue...
> > Just a hint..
>
> > On May 31, 12:50 am, Abhimanyu Grover <[EMAIL PROTECTED]> wrote:
>
> > > Using key is fine, but what I dont want to use is this:
> > > $session->flash('warning');
>
> > > In default.ctp, I want it to output message itself with the different
> > > CSS for different types of messages using $session->flash();
> > >  For that I need to change a bit of SessionHelper::flash()
>
> > > On May 31, 3:12 am, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > You can use the 4th parameter of session component to set a key on
> > > > your message:
>
> > > > $this->Session->setFlash("message", 'default', array(), 'warning');
> > > > $this->Session->setFlash("message", 'default', array(), 'error');
>
> > > > and then in view, you can get the message with a "key"  (default:
> > > > "flash", and Auth component uses 'auth'):
>
> > > > $session->flash('warning');
> > > > $session->flash('error');
>
> > > > hth
>
> > > > On May 31, 12:04 am, Abhimanyu Grover <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi Guys,
>
> > > > > I'm writing a reusable CMS. I'm stuck at some problem, which I believe
> > > > > is easy to figure out...
>
> > > > > I want to overwrite a function SessionHelper::flash() what would be
> > > > > the easiest way to do so?
> > > > > Basically, I'm adding different types of message support to it:
> > > > > success / error / warning.
>
> > > > > Looking forward to your response... (cant find it anywhere)
>
> > > > > Thanks,
> > > > > Abhimanyu Grover
--~--~---------~--~----~------------~-------~--~----~
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