views:

106

answers:

2

Hello,

I currently use zend_navigation via an XML file.

However I need to overwrite the previous breadcrumb to be its dynamic parent, in the controller.

Is this possible? It seems to me that zend_navigation is fairly static and the zend documentation keeps timing out.

Thanks

+1  A: 

Yes you can use an array.

What you should do really is create your array and then input it into the factory of the Zend_Navigation to create your pages for you.

Unfortunately my code is too complicated to show an example of how I used it. But I'll provide a simple example...

Once you create your navigation container, you can just add new pages to it.

Like

$this->navigation()->addPage(array(
   'type' => 'uri',
   'label' => 'New page'));

But you can also use addPages(). This is what I do.

I think you should just wait for the documentation to load back up for you and then look at that. Its really easy in fact.

When you have a more specific question, just ask that and give me a poke. I've had to use Navigation quite a lot so know it quite well.

Additionally, check out #zftalk on freenode. Theres lots of help on there.

Laykes
Thank you, is the zend documentation loading for you?
azz0r
Yes it is. It loads without a hitch.
Laykes
A: 

I have put:

    public function addAction() {

        $this->view->navigation()->addPage(array(
            'type' => 'uri',
            'label' => 'New page')
        );

in my controller but no crumbbar shows up for that page.

Any ideas? $this->navigation() threw a

Method "navigation" does not exist and was not trapped in __call() 

Also of note that my crumbBar is in my layout and not individual views.

azz0r
Its because I'm not accessing the layout navigation. So I tried finding a way to load the layout object in the controller action but nothing conclusive come up.hmf
azz0r
edit im being stupid, in my bootstrap I set it to the view.I guess im getting a better understand of the way the view / layout works. Still not quite sure how to overwrite the navigation object on the view though from the controller
azz0r