【发布时间】:2011-06-05 06:40:04
【问题描述】:
我有一个测试模块。
我在 myproject/application/modules/test/lists/Profiles.php 中有一个类
class Test_List_Profiles {
// class members
}
现在当我在 myproject/application/modules/test/controllers/ProfileController.php
中访问此类时public function indexAction() {
$profilesList = new Test_List_Profiles();
}
它给了我以下错误:
Fatal error: Class 'Test_List_Profiles' not found
我在 Bootstrap.php 中也有以下条目:
protected function _initAutoload() {
$autoLoader = Zend_Loader_Autoloader::getInstance();
$testModuleLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => APPLICATION_PATH . 'modules/test',
'namespace' => 'Test_',
'resourceTypes' => array( 'form' => array( 'path'=>'forms/', 'namespace'=>'Form_' ),
'list' => array( 'path'=>'lists/', 'namespace'=>'List_' )
)
));
}
如何在项目中随处访问 Test_List_Profiles 类?
谢谢
【问题讨论】:
-
Notification_List_Notifications 是在哪里定义的?
-
@zeeshan:这是拼写错误。请再次查看问题..
标签: php zend-framework module bootstrapping