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

  • Home
  • SEARCH
  • 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 am using the Zend Framework. I have a controller named 'UserController' that has
I have a Zend Framework application that is making use of jQuery UI. In
I have a application built using Zend Framework. I have decided to go with
I am using Zend Framework(MVC part of it), and need to either redirect user
I have been using the Zend Framework with an MVC configuration, read about Ruby
I am developing a web application with Zend Framework, and I am using JQuery
Using the Zend Framework , I have a menu and want to put it
I am using Zend Framework 1.6 hence I'm not utilizing Zend_Application. I have a
I'm using Zend Framework and on one of my forms I have a ZendX
I'm using Zend Framework version 1.7.8. I am trying to create a class that

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.