[Solar-talk] Solar_Session and "flashes"

Paul M Jones pmjones at solarphp.com
Tue Oct 17 09:02:57 PDT 2006


On Oct 14, 2006, at 10:24 AM, Matt M. wrote:

> I have a session class that also does "flashing". But the one  
> difference is that it stores the messages in a static array with  
> the function. So you can get the flash more than once per request.  
> But the flash value is still removed from the session. Here is an  
> example of what I mean and it'd be great to have this feature in  
> Solar_Session!
>
> class Solar_Session {
>
>     /**
>      * replacing the original Solar_Session::getFlash() method
>      */
>     function getFlash($key, $val=NULL){
>         static $store;
>         $store = isset($store) ? $store : array();
>         if( isset($this->flash[$key]) ){
>             $store[$key] = $this->flash[$key];
>             unset($this->flash[$key]);
>         }
>         return isset($store[$key]) ? $store[$key] : NULL;
>     }
>
> }

Hey, that's a pretty cool idea; where'd you come up with this from?

I see you've entered it as a feature request too; I'll look at it in  
depth later.

Thanks for the suggestion!


--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.   <http://solarphp.com>

Savant: The simple, elegant, and powerful solution for
templates in PHP.   <http://phpsavant.com>




More information about the solar-talk mailing list