login  Naam:   Wachtwoord: 
Registreer je!
 Forum

[ZF] Zend_Navigation (Opgelost)

Offline Oneday - 12/03/2011 20:33 (laatste wijziging 12/03/2011 20:34)
Avatar van OnedayNieuw 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:

  1. protected function _initNavigation()
  2. {
  3.  
  4. $this->bootstrap('View');
  5. $view = $this->getResource('View');
  6.  
  7. $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
  8.  
  9.  
  10. $container = new Zend_Navigation($config);
  11. $view->navigation($container);
  12. }


Nu zou ik in m'n layout.phtml met behulp van
  1. <?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:
  1. object(Zend_Navigation)[33]
  2. protected '_pages' =>
  3. '0000000076a073e5000000000c062497' =>
  4. object(Zend_Navigation_Page_Uri)[39]
  5. protected '_uri' => string '/' (length=1)
  6. protected '_label' => string 'Home' (length=4)
  7. protected '_id' => null
  8. protected '_class' => null
  9. protected '_title' => null
  10. protected '_target' => null
  11. protected '_rel' =>
  12. ...
  13. protected '_rev' =>
  14. ...
  15. protected '_order' => null
  16. protected '_resource' => null
  17. protected '_privilege' => null
  18. protected '_active' => boolean false
  19. protected '_visible' => boolean true
  20. protected '_parent' =>
  21. &object(Zend_Navigation)[33]
  22. protected '_properties' =>
  23. ...
  24. protected '_pages' =>
  25. ...
  26. protected '_index' =>
  27. ...
  28. protected '_dirtyIndex' => boolean true
  29. protected '_index' =>
  30. '0000000076a073e5000000000c062497' => null
  31. protected '_dirtyIndex' => boolean true


m'n navigation.xml ziet er exact hetzelfde uit als in de tutorial =
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4. Document : navigation.xml
  5. Created on : 12 maart 2011, 19:32
  6. Author : kaj
  7. Description:
  8. Purpose of the document follows.
  9. -->
  10.  
  11. <configdata>
  12. <nav>
  13. <home>
  14. <label>Home</label>
  15. <uri>/</uri>
  16. <pages>
  17. <about>
  18. <label>About</label>
  19. <uri>index/about</uri>
  20. </about>
  21. <contact>
  22. <label>Contact</label>
  23. <uri>index/contact</uri>
  24. </contact>
  25. </pages>
  26. </home>
  27. </nav>
  28. </configdata>


Waar zou het aan kunnen liggen dat het bij mij niet werkt??

2 antwoorden

Gesponsorde links
Offline lemoinet - 12/03/2011 20:38
Avatar van lemoinet PHP gevorderde echo vergeten
  1. <?php echo $this->navigation()->menu(); ?>
Offline Oneday - 12/03/2011 20:39
Avatar van Oneday Nieuw lid
lemoinet schreef:
echo vergeten
[..code..]

Aargh Hoe kan ik nu zo'n stomme fouten over 't hoofd zien.. Bedankt!
Gesponsorde links
Je moet ingelogd zijn om een reactie te kunnen posten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.214s