[Solar-talk] Solar_Session and "flashes"

Matt M. goodieboy at gmail.com
Sat Oct 14 08:24:07 PDT 2006


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

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.killersoft.com/pipermail/solar-talk/attachments/20061014/cfd2b58f/attachment.htm 


More information about the solar-talk mailing list