Nico Knoll Posted October 8, 2012 Posted October 8, 2012 Hey, is it possible to save the whole pagearray for a page in $session? Or at least a whole regular array? Greets, Nico
diogo Posted October 8, 2012 Posted October 8, 2012 Why do you need that? can't you keep only the necessary info to build the array?
ryan Posted October 8, 2012 Posted October 8, 2012 It should be fine to put in a regular array (of non-objects), but I don't think a PageArray will work. Whatever you put in $session is best reduced to a native PHP type, so to stuff a PageArray into $session, I would typecast it to a string: $session->pageArray = (string) $pageArray; And to pull it out in the next request, pass that string to $pages->find(), which will turn it back into a PageArray: $pageArray = $pages->get("id=$session->pageArray"); 2
Nico Knoll Posted October 9, 2012 Author Posted October 9, 2012 I'm just looking for a better way for my preview solution
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now