Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. // Base navigation.
  3. $configPath = APPLICATION_PATH . '/configs/navigation/admin/';
  4. $config = new \Zend_Config_Xml($configPath . 'base.xml', 'navigation', true);
  5.  
  6. // Create base navigation.
  7. $navigation = new \Zend_Navigation($config);
  8.  
  9. // Module navigations.
  10. $iterator = new \DirectoryIterator($configPath);
  11. while ($iterator->valid())
  12. {
  13. if ($iterator->getFilename() == '.'
  14. || $iterator->getFilename() == '..'
  15. || $iterator->getFilename() == 'base.xml') {
  16. $iterator->next();
  17. continue;
  18. }
  19.  
  20. // Create new module navigation.
  21. $moduleConfig = new \Zend_Config_Xml($configPath . $iterator->getFilename(), 'navigation', true);
  22.  
  23. // Add module pages to base navigation.
  24. $navigation->addPages($moduleConfig);
  25.  
  26. $iterator->next();
  27. }
Add Comment
Please, Sign In to add comment