我剛開始使用zend框架。我在Zend中創建了一個項目zend框架模型創建錯誤
結構
application
configs
application.ini
layouts
modules
core
DB
Dbclass.php
Table
default
controllers
views
forms
bootstrap.php
library
public
index
我的引導文件包含
public function _autoload(){
set_include_path(
'/application/modules/core/DB'
. PATH_SEPARATOR .
'/application/modules/core/Table'
. PATH_SEPARATOR .
get_include_path());
}
public function _init(){
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
'default' => APPLICATION_PATH.'/modules/default/controllers'
));
}
我的application.ini文件包含
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "Europe/London"
;includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
;resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirectory = APPLICATION_PATH "/modules/controllers"
resources.frontController.defaultModule = "default"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 0
當我的IndexController
創建一個對象$new_object = new Dbclass();
有跡象表明
Fatal error: Class 'Dbclass' not found in D:\xampp\htdocs\pubman\application\modules\default\controllers\IndexController.php on line 16
如果任何人知道這一點請大家幫我一個錯誤。
在此先感謝。
爲什麼不用ZF2而不是ZF1開始? – sdespont 2013-02-26 15:39:15