Re: How to go about RoR-style Controller::flash

2006-11-09 Thread Evan

better yet, you can also override AppController::flash()

function flash($message, $redirect_url = null, $key = 'flash')
{
$this->Session->setFlash($message, 'default', array(), $key);

if ($redirect_url != null) {
$this->redirect($redirect_url);
}
}


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to go about RoR-style Controller::flash

2006-11-09 Thread james revillini

Thanks so much!

Hm, I have used bake but did not notice this feature.

On Nov 9, 10:12 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> Actually there is something similar
>
> in the controller at the end of the method calling path can do this
>
> $this->Session->setFlash('The Role has been saved');
> seehttp://api.cakephp.org/class_session_component.html#75c36eab6a62904b4...
> can also define layouts for this
>
> then somewhere in your layouts (like the default) you can add
>
> check('Message.flash'))
> {
> $session->flash();
> }
> ?>
>
> It's how the default app is set up now and what you get if you use bake.php
>
> enjoy
>
> Sam D
> On 11/9/06, james revillini <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > If you haven't seen the RoR Screencast: Creating a blog in 15 minutes
> > with Ruby on Rails, check it out so you have some context to what I'm
> > asking about here:
> >http://media.rubyonrails.org/video/rails_take2_with_sound.mov
>
> > Now that you've seen how the flash method works within the RoR
> > controller, I ask: how do I make mine function in that fashion.
>
> > The built-in flash layout and controller method in Cake essentially
> > goes to a blank page, shows the message, then redirects to wherever you
> > specify.
>
> > The RoR flash method seems to put the message at the top of the page
> > you've redirected to.
>
> > Here's my real-world scenario.  I'm building a wiki.  The user is on
> > the home page.  They click a Login link at the top of the page.  They
> > redirect to the login form.  They enter credentials.  I need to say
> > something at the end of the login action that says 'go back to the home
> > page and flash this message on the screen.'
>
> > Can anyone give me a suggestion on that?
>
> > Part 2 of my question:
> > I want to make the message have something to draw attention to it, so
> > the user will be encouraged to read it, but then have it become more
> > subtle.  Ta-da list does this.  When I click 'Add' to add my new item
> > to the list, it adds itself to the list with a yellow background, then
> > fades out to white.  I want to do the same thing.  I assume that I
> > would just do this using a library like scriptaculous or Yahoo UI
> > Library, but if Cake has some built-in way of achieving that, I'd like
> > to hear about it.
>
> > Thanks for reading my long question!  Peace.--
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: How to go about RoR-style Controller::flash

2006-11-09 Thread Samuel DeVore
Actually there is something similarin the controller at the end of the method calling path can do this$this->Session->setFlash('The Role has been saved');  see 
http://api.cakephp.org/class_session_component.html#75c36eab6a62904b4378978cf72a307e you can also define layouts for thisthen somewhere in your layouts (like the default) you can add check('
Message.flash'))                    {                        $session->flash();                    }?>It's how the default app is set up now and what you get if you use bake.phpenjoy
Sam DOn 11/9/06, james revillini <[EMAIL PROTECTED]> wrote:
If you haven't seen the RoR Screencast: Creating a blog in 15 minuteswith Ruby on Rails, check it out so you have some context to what I'masking about here:
http://media.rubyonrails.org/video/rails_take2_with_sound.movNow that you've seen how the flash method works within the RoRcontroller, I ask: how do I make mine function in that fashion.The built-in flash layout and controller method in Cake essentially
goes to a blank page, shows the message, then redirects to wherever youspecify.The RoR flash method seems to put the message at the top of the pageyou've redirected to.Here's my real-world scenario.  I'm building a wiki.  The user is on
the home page.  They click a Login link at the top of the page.  Theyredirect to the login form.  They enter credentials.  I need to saysomething at the end of the login action that says 'go back to the home
page and flash this message on the screen.'Can anyone give me a suggestion on that?Part 2 of my question:I want to make the message have something to draw attention to it, sothe user will be encouraged to read it, but then have it become more
subtle.  Ta-da list does this.  When I click 'Add' to add my new itemto the list, it adds itself to the list with a yellow background, thenfades out to white.  I want to do the same thing.  I assume that I
would just do this using a library like scriptaculous or Yahoo UILibrary, but if Cake has some built-in way of achieving that, I'd liketo hear about it.Thanks for reading my long question!  Peace.

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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  -~--~~~~--~~--~--~---


How to go about RoR-style Controller::flash

2006-11-09 Thread james revillini

If you haven't seen the RoR Screencast: Creating a blog in 15 minutes
with Ruby on Rails, check it out so you have some context to what I'm
asking about here:
http://media.rubyonrails.org/video/rails_take2_with_sound.mov

Now that you've seen how the flash method works within the RoR
controller, I ask: how do I make mine function in that fashion.

The built-in flash layout and controller method in Cake essentially
goes to a blank page, shows the message, then redirects to wherever you
specify.

The RoR flash method seems to put the message at the top of the page
you've redirected to.

Here's my real-world scenario.  I'm building a wiki.  The user is on
the home page.  They click a Login link at the top of the page.  They
redirect to the login form.  They enter credentials.  I need to say
something at the end of the login action that says 'go back to the home
page and flash this message on the screen.'

Can anyone give me a suggestion on that?

Part 2 of my question:
I want to make the message have something to draw attention to it, so
the user will be encouraged to read it, but then have it become more
subtle.  Ta-da list does this.  When I click 'Add' to add my new item
to the list, it adds itself to the list with a yellow background, then
fades out to white.  I want to do the same thing.  I assume that I
would just do this using a library like scriptaculous or Yahoo UI
Library, but if Cake has some built-in way of achieving that, I'd like
to hear about it.

Thanks for reading my long question!  Peace.


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---