Я использую Zend_Application_Bootstrap_Bootstrap, но фреймворк не может загрузить модели.
Index.php
define('ROOT_PATH', realpath(dirname(dirname(__FILE__))));
define('APP_PATH', realpath( ROOT_PATH . '/application'));
set_include_path(realpath(ROOT_PATH . '/library') . PATH_SEPARATOR . get_include_path());
require_once 'Zend/Application.php';
$app = new Zend_Application('dev', APP_PATH . '/configs/application.ini');
$app->bootstrap()->run();
Application.ini
bootstrap = APP_PATH "/Bootstrap.php"
phpSettings.display_errors = on
phpSettings.display_startup_errors = on
phpSettings.error_reporting = E_ALL|E_STRICT
phpSettings.date.timezone = "Europe/London"
resources.frontController.controllerDirectory = APP_PATH "/controllers"
resources.frontController.throwExceptions = on
resources.view.encoding = "UTF-8"
resources.view.contentType = "text/html;charset=utf-8"
resources.view.doctype = "XHTML1_STRICT"
resources.layout.layoutPath = APP_PATH "/views/layouts"
resources.layout.layout = "layout"
resources.db.adapter = "Pdo_Mysql"
resources.db.params.host = "localhost"
resources.db.params.dbname = "foo"
resources.db.params.username = "user"
resources.db.params.password = "password"
resources.db.params.charset = "utf8"
Bootstrap.php:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
Дерево папок:
Myproject->
/application
/configs
/controllers
/models
/Mytest.php
/views
Bootstrap.php
/public
index.php
Проблема: Я пытаюсь создать новый Mytest () в контроллере, но я получаю "класс не найден в ...", когда я добавляю в загрузчик Zend_Loader :: loadClass ('Mytest', APP_PATH. '/ Models /'), все работает.
Мои вопросы : как настроить Zend_Application_Bootstrap_Bootstrap через application.ini для папки автозагрузки моделей?
Спасибо.