Re: Auto-load class if it doesn't exists!
| From: | Jonel Rienton | Date: | Tue, 16 Nov 2004 18:41:48 +0000 |
| Subject: | Re: Auto-load class if it doesn't exists! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202196@lists.php.net to get a copy of this message | ||
Hi,
you would need something like a singleton class if my memory serves me.
cheers,
jonel
--
I not know English well, but I know 7 computer languages.
----anonymous
On Nov 16, 2004, at 11:36 AM, Bruno B B Magalhães wrote:
Hi people, is it possible to have a solution that works like an autoloader... for example: $myclass = new class(); but if this class wasn't loaded yet, it loads by itself... egg: if(class_exists(class)) {$myclass = new class();} else {require_once(PATH_DIR.'class.class.php'); $myclass = new class();} Regards, Bruno B B Magalhaes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php