我有一個測試模塊。如何在Zend中爲模塊添加資源?
我在的myproject /應用/模塊/測試/列表一類/ Profiles.php
class Test_List_Profiles {
// class members
}
現在,當我在的myproject /應用/模塊/測試/控制器訪問該類/ 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類無處不在的項目?
感謝
很多錯別字固定.. – Student 2011-06-05 06:45:34
其中Notification_List_Notifications是在哪裏定義的? – 2011-06-05 06:46:37
@zeeshan:拼寫錯誤。請再次檢查問題。 – Student 2011-06-05 07:16:04