1. Automatic loading of classes in modules
Copy code The code is as follows:
$loader = new Zend_Application_Module_Autoloader(array( //Module content automatic loading class
'namespace' => 'Blog',//The namespace definition means the beginning of the method is Blog_
'basePath' => APPLICATION_PATH . '/modules /blog',//Module location
));
2. Automatic loading
Copy code The code is as follows:
require_once 'Zend/Loader/Autoloader.php';
$loader =Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace( 'Application_');
//Please pay attention to whether the loaded directory address has been loaded
http://www.bkjia.com/PHPjc/327949.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327949.htmlTechArticle1. The copy code for automatic loading of classes in the module is as follows: $loader = new Zend_Application_Module_Autoloader(array( // Module content automatically loads class 'namespace' = 'Blog', // Namespace definition...