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 1058641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:03:16+00:00 2026-05-16T18:03:16+00:00

I am using Zend_Layout for the layout of my Zend Framework application. It is

  • 0

I am using Zend_Layout for the layout of my Zend Framework application. It is very simple, but I still have a few operations that I need to do in the layout. For now, the code is included between PHP brackets, but I feel like this is not really the cleanest way to go.

I saw people using plugins, but I don’t think this is the way I want to go. Oviously, I could extract the “complicated” part, do it in a nice action/controller manner, and use a placeholder in the layout. Is this the way to go ? Do you have examples of such things (for instance the navigation menu delegated in its own action) ?

  • 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-16T18:03:16+00:00Added an answer on May 16, 2026 at 6:03 pm

    As takeshin said, the navigation() placeholder is probably the way to go. However, I did not want to go through the setup of Zend_Navigation for this particular case, so I used a custom view helper.

    application/views/helpers/Menu.php :

    <?php
    
    class Zend_View_Helper_Menu extends Zend_View_Helper_Abstract {
    
        public function menu() {
            // my code ...
            $this->view->menu = $menu;
    
            return $this->view->render('helpers/menu.phtml');
        }
    
    }
    

    application/views/scripts/helpers/menu.phtml :

    <ul>
        <?php foreach ($this->menu as $item) { // print menu } ?>
    </ul>
    

    This way, I can simply call this helper from my layout :

    ...
    <div id="menu">
        <?php echo $this->menu(); ?>
    </div>
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working zend mvc application that is using a layout, and this
I have a Zend Framework application that is making use of jQuery UI. In
I am using Zend Framework, I have a layout.phtml which renders navigation.phtml. How can
I have a application built using Zend Framework. I have decided to go with
I have build a CMS using Zend Framework (1.11). In the application I have
I have been building a dynamic form in my Zend Framework application using Jquery
I've recently started using Zend Framework and I'm still pretty used to session_start, and
I want to write a php application using Zend Framework 2 (just the beta
I have been working on a new installation of a Zend Framework application for
Using the Zend Framework , I have a menu and want to put it

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.