Passing classes among PHP pages
I'm trying to make a website using OOP with classes. Aside from passing a class using the $_GET and $_POST, how do I use an instance of a class on more than the in which the class is instantiated?
For instance, I have a class in organization.php, I create an instance of it in class.php, but I want to use variables set in class.php in test.php.
you could make it a singleton class or serialize it in class.php and save it in a file and then in test.php retrieve the file contents and unserialize it. But some class serialization sometimes dont keep the content of properties of a class if the property value is an instance, resource, or reference.
|All times are GMT. The time now is 05:43 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0