note 97837 deleted from function.spl-autoload-register by danbrown
| From: | danbrown@php.net | Date: | Tue, 11 May 2010 17:47:54 +0000 |
| Subject: | note 97837 deleted from function.spl-autoload-register by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169151@lists.php.net to get a copy of this message | ||
Note Submitter: ryanhennessy at idontwanttotell dot com
----
If you want your autoload to be within a class you can do the following:
class exampleClass{
function __construct(){
spl_autoload_register(array("exampleClass","myAutoLoad"));
}
static myAutoLoad($class){
require_once $class.'.php';
}
public function creatClass(){
$obj = new someClass();
}
}