我们正在开发一个新的 zend 框架项目,并且大多数事情都与引导程序有关:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'List8D',
'basePath' => dirname(__FILE__),
));
return $autoloader;
}
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_TRANSITIONAL');
}
protected function _initRegistry()
{
$this->bootstrap('db');
Zend_Registry::set('dbResource', $this->getPluginResource('db'));
}
}
但是我们想向 List8D 命名空间添加第二条路径,这样如果自动加载器在其中找不到它,它就会在dirname(__FILE__)
那里查找
我查看了文档,发现很多关于添加命名空间但没有为同一个命名空间设置多个路径