Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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();
- }
Add Comment
Please, Sign In to add comment