我创建了一个包含这些详细信息的应用程序:
1- zf 创建项目 MyApp
2- zf 创建模块管理员
3- zf 创建控制器索引 1 管理员
MyApp/application/modules/admin/controllers/IndexController.php:
class admin_IndexController extends Zend_Controller_Action
{
public function init()
{
error_reporting(E_ALL);
ini_set('display_errors', 'On');
}
public function indexAction()
{
$aa = new Admin_Model_DbTable_Posts();
}
}
应用程序.ini:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
MyApp/application/modules/admin/models/DbTable/Posts.php:
class Admin_Model_DbTable_Posts extends Zend_Db_Table_Abstract
{
public function init()
{
}
}
在这一点上,我得到了错误:
Fatal error: Class 'Admin_Model_DbTable_Posts' not found in /var/www/MyApp/application/modules/admin/controllers/IndexController.php on line 16
当我把这条线放在 application.ini
resources.modules[] =
并将这些内容添加到 admin 文件夹中的 bootstratp.php
class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
经过长时间的请求,我收到此错误:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
我应该怎么做才能让它工作?