Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help with Zend Navigation XML

Currently I'm developing a web application. Which consist of frontend and backend interface.

Therefore I would have 2 separate navigation,one for the frontend and one for the backend.

So what is the best way to achieve this? Does Zend framework support 2 Separate Zend Navigation Object?

Thanks you so much in advance!

Here is my Zend navigation Code in bootstrap.php

protected function _initNavigation()
{
    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();
    $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml','nav');
    $navigation = new Zend_Navigation($config);
    $view->navigation($navigation);

    }

Here is my view code

<?php echo $this->navigation()->menu()
like image 567
user648198 Avatar asked Nov 28 '25 03:11

user648198


1 Answers

Of course it support's it :) I think that you use modulues, right ? Default and admin ... Just create a bootstrap file

class Default_Bootstrap extends Zend_Application_Module_Bootstrap {}

...and...

class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {}

... in which you can create navigation for each module separately.

If you don't use modules then simply create two objects

$navigation = new Zend_Navigation($config);
$navigationAdmin = new Zend_Navigation($configAdmin);
like image 177
grongor Avatar answered Nov 30 '25 16:11

grongor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!