title: Add Zend_Navigation to the View with old legacy bootstrap
body: <p>I've been struggling with Zend_Navigation all weekend, and now I have another problem, which I believe has been the cause of a lot of my issues.</p>
  
  <p>I am trying to add Zend_Navigation to a legacy 1.7.6 Zend Framework application, i've updated the Zend Library to 1.9.0 and updated the bootstrap to allow this library update.</p>
  
  <p>The problem is that I don't know how, and the examples show the new bootstrap method of how to add the Navigation object to the view, I've tried this:</p>
  
  <pre><code>//initialise the application layouts with the MVC helpers
  $layout = Zend_Layout::startMvc(array('layoutPath' =&gt; '../application/layouts'));
  
  $view = $layout-&gt;getView();
  $configNav = new Zend_Config_Xml('../application/config/navigation.xml', 'navigation');
  $navigation = new Zend_Navigation($configNav);
  $view-&gt;navigation($navigation);
  $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
  $viewRenderer-&gt;setView($view); 
  </code></pre>
  
  <p>This seems to run through fine, but when I go to use the breadcrumb view helper in my layout, it errors with: <strong>Strict Standards: Creating default object from empty value in C:\www\moobia\development\website\application\modules\employers\controllers\IndexController.php  on line 27</strong></p>
  
  <p>This is caused by the following code in the init() function of my controller.</p>
  
  <pre><code>$uri = $this-&gt;_request-&gt;getPathInfo();
  $activeNav = $this-&gt;view-&gt;navigation()-&gt;findByUri($uri); &lt;- this is null when called
  $activeNav-&gt;active = true;
  </code></pre>
  
  <p>I believe it's because the Zend_Navigation object is not in the view.</p>
  
  <p>I would look at migrating the bootstrap to the current method, but at present I am running out of time for a release.</p>
  
  <p>Thanks,</p>
  
  <p>Grant</p>