Problem loading Zend Framework

I have been working on a new installation of the Zend Framework application for a long time, and I can not understand what is happening. I have two special action assistants that I would like to use, and I would like to initialize them in bootstrap. But it seems that my _init functions are not called at all. In index.php, which launches the application, I:

require('Zend/Application.php');

$app = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH 
.'/configs/application.ini');

$app->bootstrap()->run();

Here is what I have in the application.ini file:

[production]

appnamespace = "Application_Name"

includePaths.library = APPLICATION_PATH "/../library"

bootstrap.path = "/home/user/website/includes/library/Application_Name/Resource/Bootstrap.php"

bootstrap.class = "Bootstrap"

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

resources.view[] =

autoloaderNamespaces[] = "Application_Name"

pluginPaths.Application_Name_Resource = "Application_Name/Resource"

I know that the application works somewhat, because it uses the layout that I have, and I can do something in controllers and views and display it on the page. I also know that it at least looks at the Bootstrap file because I can make a PHP error when I leave the end of the curly bracket.

Here is part of my Bootstrap file:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

        public function _init()
        {
                Zend_Controller_Action_HelperBroker::addPrefix(new Application_Name_Controller_Action_Helper_ResourceInjector());
                Zend_Controller_Action_HelperBroker::addPrefix(new Application_Name_Controller_Action_Helper_Em());
        }

, -, ? Zend, , , .

+3
1

. addPrefix() , .

( ), - Bootstrap

protected function _initActionHelpers()
{
    $helper = new My_Helper;
    Zend_Controller_Action_HelperBroker::addHelper($helper);
}

,

resources.frontController.actionHelperPaths.ProEquipTrack_Controller_Action_Helper = "ProEquipTrack/Controller/Action/Helper"

, ( )

$resourceInjector = $this->getHelper('ResourceInjector');
$em = $this->getHelper('Em');

( direct())

$this->_helper->resourceInjector($arg1, $arg2 /*, etc */);

Doctrine Entity Manager

- Bootstrap

protected function _initDoctrine()
{
    // initialise and create entity manager
    $em = // whatever

    return $em;
}

,

$em = $this->getInvokeArg('bootstrap')
           ->getResource('doctrine');
+3

All Articles