-- wenbert <[EMAIL PROTECTED]> wrote
(on Monday, 10 March 2008, 03:34 AM -0700):
> 
> In comment #43 and #44
> http://akrabat.com/2007/12/11/simple-zend_layout-example/#comments
> 
> Rob says that:
> $view->addHelperPath('path/to/incubator/library/Zend/View/Helper/');
> is unnecessary for the 1.5 RC1. what does he mean by that?

Originally, Zend_Layout was developed in the incubator. Zend_View places
the helpers in its own directory tree in the helper path... but when you
have helpers in the incubator as well, you need to manually add that
path to Zend_View so it will find the. So, while Zend_Layout was
developed in the incubator, you needed to add the above line to ensure
that the new helpers were loaded properly.

Since Zend_Layout was moved to core (which happened in December,
actually), the above has not been necessary, and in both the Preview
Release as well as RC1, you have not needed the above line.


> in my bootstrap, i have something like this:
> -------------------------------------------------
> // setup layouts
> Zend_Layout::startMvc(array('layoutPath' =>
> '../application/views/layouts'));
> 
> // setup plugins
> require_once 'Ekini/Controller/Plugin/CheckHasAccess.php';
> $frontController = Zend_Controller_Front::getInstance();
> $frontController->registerPlugin(new
> Ekini_Controller_Plugin_CheckHasAccess());
> 

You can cut from here:

> // setup view helpers
> $view = new Zend_View();
> $view->addHelperPath('../application/views/helpers', 'My_View_Helper');
> $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
> $viewRenderer->setView($view);
> 
> //make view renderer use the view we just configured
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

To here, as you no longer need to set the extra helper path in the view.
(The ViewRenderer is loaded automatically normally; the above just
ensured the extra path was added to the view object contained by it.)

> //setup action helpers
> Zend_Controller_Action_HelperBroker::addPrefix('Ekini_Controller_Action_Helper');
>  
> 
> // setup controller
> //Zend_Controller_Front::run('../application/controllers');
> // Run!
> $frontController = Zend_Controller_Front::getInstance();
> $frontController->addControllerDirectory('../application/controllers');
> $frontController->throwExceptions(true);
> try {
>     $frontController->dispatch();
> } catch(Exception $e) {
>     echo nl2br($e->__toString());
> }
> -------------------------------------------------
> What would I change it to?

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to