Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3339844
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:32:22+00:00 2026-05-18T00:32:22+00:00

I am using Zend Framework 1.10.8. I want to create a breadcrumb section in

  • 0

I am using Zend Framework 1.10.8.

I want to create a breadcrumb section in my layout.phtml. There are some links in my menu that have dynamic url parameters like http://mydomain.com/editor/edit/id/42

I try to figure out how to pass id=XXX to Zend_Navigation, while XXX comes from the database and is different in every request.

One solution I found so far is adding a property e.g. params_id to my xml declaration:

in configs/navigation.xml

<pages>
   <editor>
     <label>Editor</label>
     <controller>editor</controller>
      <action>edit</action>
     <params_id>id</params_id>
     <route>default</route>  
  </editor>
 </pages>

and in the controller looping through the pages and dynamically adding my parameter id = 42 (while 42 would be retrieved from the request object in the final version)

$pages = $this->view->navigation()->getContainer()->findAllBy('params_id','id');
            foreach ($pages as &$page) {
                $page->setParams(array(
                    'id' => 42,
                    'something_else' => 667

                ));
 }

As adding dynamic url parameters seems such a basic requirement for Zend_Navigation I am quite sure that my solution is too complicate, too expensive and there must be a much simplier solution “out of the box”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:32:22+00:00Added an answer on May 18, 2026 at 12:32 am

    It is very simple. Just write in your XML

    <pages>
        <editor>
            <label>Editor</label>
            <controller>editor</controller>
            <action>edit</action>
            <params>
                <id>42</id>
                <someting_else>667</something_else>
            </params>
            <route>default</route>  
        </editor>
    </pages>
    

    Here is example to do it dynamically based on database data

    First define Navigation loading plugin. Name the file Navigation.php and place it in application/plugins/ directory. Here’s an example of such plugin:

    class Plugin_Navigation extends Zend_Controller_Plugin_Abstract
    {
        function preDispatch(Zend_Controller_Request_Abstract $request)
        {
            $view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;
    
            //load initial navigation from XML
            $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml','nav');
            $container = new Zend_Navigation($config);
    
            //get root page
            $rootPage = $container->findOneBy('sth', 'value');
    
            //get database data
            $data = Model_Sth::getData();
    
            foreach ($data as $row) {
                $rootPage->addPage(new Zend_Navigation_Page_Mvc(array(
                    'module'     => 'default',
                    'controller' => 'examplecontroller',
                    'action'     => 'exampleaction',
                    'route'      => 'exampleroute',
                    'label'      => $row['some_field'],
                    'params'     => array(
                        'param1' => $row['param1'],
                        'param2' => $row['param1']
                    )
                )));
            }
    
            //pass container to view
            $view->navigation($container);
        }
    }
    

    Then in you Bootstrap init this plugin

    protected function _initNavigation() {
        Zend_Controller_Front::getInstance()->registerPlugin(new Plugin_Navigation());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Zend Framework for some projects and want to build up PHPUnit test
I'm using the Zend Framework to create an API I want to use apache
I have PHP project and I am using Zend Framework. There is a library
Am developing an app using zend framework. I want to update some columns in
I am using zend framework and want to create a zend form where the
I want to get the out parameter of stored procedure using Zend framework Here's
I want to write a worker for beanstalkd in php, using a Zend Framework
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
I'm trying to develop a site using Zend Framework, but i have a problem:
I am using zend framework 1.10. I use the zf tool to create controllers,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.