|
Posted by Richard Lynch on 05/12/05 04:59
On Wed, May 11, 2005 5:19 pm, Oscar Andersson said:
> Is it possibele to save a class in a session
>
> ex.
>
> $cl = new Class();
> $SESSION['this_class'] = cl;
Yes, but...
You'd have to actually use $cl in that last line, and you need to require
the file that defines the class definition *BEFORE* you start your session
in the next page where you expect the class instance to exist.
Actually, you could maybe get away with starting the session, the loading
the class definition, then accessing the $cl variable... But I'm not sure
of that, because I don't use classes, and even if I did, I'd load in all
the class files before I started my session, just on principle.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|