Nieuw lid |
|
Hey,
ik heb deze tutorial volledig opgevolgd om de plugin Zend_Navigation te gebruiken:
http://www.zend...bs/2009/06/
Heb volgende code in m'n bootstrap staan:
protected function _initNavigation()
{
$this->bootstrap('View');
$view = $this->getResource('View');
$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$container = new Zend_Navigation($config);
$view->navigation($container);
}
protected function _initNavigation() { $this->bootstrap('View'); $view = $this->getResource('View'); $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav'); $container = new Zend_Navigation($config); $view->navigation($container); }
Nu zou ik in m'n layout.phtml met behulp van
<?php $this->navigation()->menu(); ?>
<?php $this->navigation()->menu(); ?>
De navigatie kunnen laten zien.. Maar 't werkt niet.
Ik heb even een Dump gedaan van $container en dat levert het volgende op:
object(Zend_Navigation)[33]
protected '_pages' =>
array
'0000000076a073e5000000000c062497' =>
object(Zend_Navigation_Page_Uri)[39]
protected '_uri' => string '/' (length=1)
protected '_label' => string 'Home' (length=4)
protected '_id' => null
protected '_class' => null
protected '_title' => null
protected '_target' => null
protected '_rel' =>
array
...
protected '_rev' =>
array
...
protected '_order' => null
protected '_resource' => null
protected '_privilege' => null
protected '_active' => boolean false
protected '_visible' => boolean true
protected '_parent' =>
&object(Zend_Navigation)[33]
protected '_properties' =>
array
...
protected '_pages' =>
array
...
protected '_index' =>
array
...
protected '_dirtyIndex' => boolean true
protected '_index' =>
array
'0000000076a073e5000000000c062497' => null
protected '_dirtyIndex' => boolean true
object(Zend_Navigation)[33] protected '_pages' => '0000000076a073e5000000000c062497' => object(Zend_Navigation_Page_Uri)[39] protected '_uri' => string '/' (length=1) protected '_label' => string 'Home' (length=4) protected '_id' => null protected '_class' => null protected '_title' => null protected '_target' => null protected '_rel' => ... protected '_rev' => ... protected '_order' => null protected '_resource' => null protected '_privilege' => null protected '_active' => boolean false protected '_visible' => boolean true protected '_parent' => &object(Zend_Navigation)[33] protected '_properties' => ... protected '_pages' => ... protected '_index' => ... protected '_dirtyIndex' => boolean true protected '_index' => '0000000076a073e5000000000c062497' => null protected '_dirtyIndex' => boolean true
m'n navigation.xml ziet er exact hetzelfde uit als in de tutorial =
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : navigation.xml
Created on : 12 maart 2011, 19:32
Author : kaj
Description:
Purpose of the document follows.
-->
<configdata>
<nav>
<home>
<label>Home</label>
<uri>/</uri>
<pages>
<about>
<label>About</label>
<uri>index/about</uri>
</about>
<contact>
<label>Contact</label>
<uri>index/contact</uri>
</contact>
</pages>
</home>
</nav>
</configdata>
<?xml version="1.0" encoding="UTF-8"?> <!-- Document : navigation.xml Created on : 12 maart 2011, 19:32 Author : kaj Description: Purpose of the document follows. --> <configdata> <nav> <home> <label>Home</label> <uri>/</uri> <pages> <about> <label>About</label> <uri>index/about</uri> </about> <contact> <label>Contact</label> <uri>index/contact</uri> </contact> </pages> </home> </nav> </configdata>
Waar zou het aan kunnen liggen dat het bij mij niet werkt??
|