【发布时间】:2009-10-10 14:33:09
【问题描述】:
我们正在开发一个新的 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__) 中找不到它,它会在那里查找
我查看了文档,发现很多关于添加命名空间的内容,但没有发现同一命名空间有多个路径
【问题讨论】:
标签: php zend-framework autoload zend-loader