user648198
user648198

Reputation: 2020

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()

Upvotes: 3

Views: 430

Answers (1)

grongor
grongor

Reputation: 1355

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);

Upvotes: 1

Related Questions