Created
September 10, 2011 15:39
-
-
Save renepardon/1208445 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Base navigation. | |
| $configPath = APPLICATION_PATH . '/configs/navigation/admin/'; | |
| $config = new \Zend_Config_Xml($configPath . 'base.xml', 'navigation', true); | |
| // Create base navigation. | |
| $navigation = new \Zend_Navigation($config); | |
| // Module navigations. | |
| $iterator = new \DirectoryIterator($configPath); | |
| while ($iterator->valid()) | |
| { | |
| if ($iterator->getFilename() == '.' | |
| || $iterator->getFilename() == '..' | |
| || $iterator->getFilename() == 'base.xml') { | |
| $iterator->next(); | |
| continue; | |
| } | |
| // Create new module navigation. | |
| $moduleConfig = new \Zend_Config_Xml($configPath . $iterator->getFilename(), 'navigation', true); | |
| // Add module pages to base navigation. | |
| $navigation->addPages($moduleConfig); | |
| $iterator->next(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment