Page 1 of 1

using Zend_Loader::loadClass and include

Posted: Wed Aug 22, 2007 6:46 am
by dude81
whats difference will it make while using Zend_Loader::loadClass and include_once or require_once.

Posted: Wed Aug 22, 2007 11:04 am
by Begby
Zend_Loader::LoadClass will find a file based on a class name and load it

For instance if you have a class named MY_Class_Name load class will search for a file in your path (or paths you specify in the function call) in a subdirecty based on the class name like: MY/Class/Name.php and include that file. If the class has already been declared then it won't try to include the file.


Require_once and include_once are used to include arbitrary files, nothing more. Using those functions you have to specify the file name instead of a class name.