-application
--configs
--controllers
--forms
--layouts
--models
--plugins
--views
--Bootstrap.php
-library
-public
--index.php
Nowy układ katalogów:
-application
--configs
--layouts
--modules
---admin
----controllers
----forms
----models
----views
---default
----controllers
----forms
----models
----views
---library
----controllers
----forms
----models
----views
--views
--Bootstrap.php
-library
-public
--index.php
Dostaje taki komunikat błędu:
CODE
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("ErrorController")' in C:\XAMPP\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php:347 Stack trace: #0 C:\XAMPP\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php(256): Zend_Controller_Dispatcher_Standard->loadClass('ErrorController') #1 C:\XAMPP\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #2 C:\XAMPP\xampp\php\PEAR\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch() #3 C:\XAMPP\xampp\php\PEAR\Zend\Application.php(358): Zend_Application_Bootstrap_Bootstrap->run() #4 C:\XAMPP\xampp\htdocs\testy\public\index.php(27): Zend_Application->run() #5 {main} thrown in C:\XAMPP\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php on line 347
Mój Bootstrap.php:
CODE
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
private $_acl;
protected function _initAutoLoad() {
$modelLoader = new Zend_Application_Module_AutoLoader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH,
'resourceTypes' => array (
'validator' => array(
'path' => 'views/validators',
'namespace' => 'Validator'
)
)
))
;
/* if(Zend_Auth::getInstance()->hasIdentity())
{
Zend_Registry::set('role',Zend_Auth::getInstance()->getStorage()->read()->role );
} else {
Zend_Registry::set('role', 'guest');
}
$this->_acl = new Model_LibraryAcl;
$this->_auth = Zend_Auth::getInstance();
$fc = Zend_Controller_Front::getInstance();
$fc->registerPlugin(new Plugin_AccessCheck($this->_acl)); */
return $modelLoader;
}
function _initViewHelpers() {
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getview();
$view->setHelperPath(APPLICATION_PATH. '/helpers', '');
Zend_Dojo::enableView($view);
$view->doctype('HTML4_STRICT');
$view->headMeta()->appendHttpEquiv('Content-Type','text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language','pl-PL')
->appendName('description', 'Using view helpers in Zend_view');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Sala');
$navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$navContainer = new Zend_Navigation($navContainerConfig);
$view->navigation($navContainer);/*->setAcl($this->_acl)->setRole(Zend_Registry::get('role'));*/
}
}
index.php
CODE
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(dirname(__FILE__) . '/../library'),
realpath(dirname(__FILE__) . '/../application'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
application.ini
CODE
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = ""
autoloadernamespaces.0 = "Zend_"
autoloadernamespaces.1 = "forms_"
resources.layout.layoutpath = APPLICATION_PATH "/layouts"
resources.db.adapter = mysqli
resources.db.isDefaultAdapter = true
resources.db.params.host = localhost
resources.db.params.username = root
resources.db.params.password = 54ajmon5
resources.db.params.dbname = zftutorial
resources.db.params.charset = 'utf8'
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
Proszę o pomoc

Pozdrawiam