Welcome Guest, Not a member yet? Register   Sign In
Make a more robust Request Cache
#1

[eluser]j2more[/eluser]
I am coming from a java background and I really miss the Page/Session/Application Cache concepts in CI and PHP generally.

One quite typicall example of this PHP / CI weakness is the flashdata. It says:

/**
* Sets "flash" data which will be available only in next request (then it will
* be deleted from session). You can use it to implement "Save succeeded" messages
* after redirect.
*/

you realize the significant wording "only for the next response" this is to be understood exacly as its written, only for the next request, but not within the same request.

What about situations where you would just like a convinient way to return multiple Objects from a method but.

So I added this little utility to the Session class:

function set_samereq_flashdata($key, $value)
{
$flash_key = $this->flash_key.':old:'.$key;
$this->set_userdata($flash_key, $value);
}


Feedback welcome..


Messages In This Thread
Make a more robust Request Cache - by El Forum - 10-17-2009, 12:10 PM
Make a more robust Request Cache - by El Forum - 10-17-2009, 12:29 PM
Make a more robust Request Cache - by El Forum - 12-14-2009, 06:26 PM
Make a more robust Request Cache - by El Forum - 12-14-2009, 07:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB