note 110142 added to function.spl-autoload
| From: | contato at felipebarth dot com dot br | Date: | Sun, 23 Sep 2012 21:14:39 +0000 |
| Subject: | note 110142 added to function.spl-autoload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190976@lists.php.net to get a copy of this message | ||
/*
* defined function responsible for loading class,
* replacing the old __ autoload.
* ROOT is constant of the path root of the system
*/
spl_autoload_extensions('.class.php');
spl_autoload_register('loadClasses');
function loadClasses($className)
{
if( file_exists(ROOT_DIR.DS.'controller/'.$className.'.class.php' ) ){
set_include_path(ROOT_DIR.DS.'controller'.DS);
spl_autoload($className);
}
elseif( file_exists('model/'.$className.'.class.php' ) ){
set_include_path(ROOT_DIR.DS.'model'.DS);
spl_autoload($className);
}elseif( file_exists('view/'.$className.'.class.php' ) ){
set_include_path(ROOT_DIR.DS.'view'.DS);
spl_autoload($className );
}else
{
set_include_path(ROOT_DIR.DS.'lib'.DS);
spl_autoload($className );
}
}
----
Server IP: 69.147.83.199
Probable Submitter: 187.113.235.108
----
Manual Page -- http://www.php.net/manual/en/function.spl-autoload.php
Edit -- https://master.php.net/note/edit/110142
Del: integrated -- https://master.php.net/note/delete/110142/integrated
Del: useless -- https://master.php.net/note/delete/110142/useless
Del: bad code -- https://master.php.net/note/delete/110142/bad+code
Del: spam -- https://master.php.net/note/delete/110142/spam
Del: non-english -- https://master.php.net/note/delete/110142/non-english
Del: in docs -- https://master.php.net/note/delete/110142/in+docs
Del: other reasons-- https://master.php.net/note/delete/110142
Reject -- https://master.php.net/note/reject/110142
Search -- https://master.php.net/manage/user-notes.php