Auto-load class if it doesn't exists!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux