-1

我们正在开发一个新的 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__)那里查找

我查看了文档,发现很多关于添加命名空间但没有为同一个命名空间设置多个路径

4

1 回答 1

-1

将 basePath 指定为数组不起作用?但我认为这样做没有多大意义。

按照思维导图:

are your classes application specific or global:
  specific
    move both folders to one folder inside application
  global 
    move both folders to one folder inside your include path
  some are specific, some global
    separate them to different namespaces

我不知道在不同文件夹中应该有相同前缀类的任何情况......

于 2009-10-10T17:49:25.940 回答