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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:16:20+00:00 2026-05-29T05:16:20+00:00

I had to create method in Boostrap which bootstraps Layout resource and registers some

  • 0

I had to create method in Boostrap which bootstraps Layout resource and registers some view helpers.

protected function _initViewHelpers() {
    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();

    $view->registerHelper(new Application_View_Helper_LoadMenu, 'loadMenu');
    $view->registerHelper(new Application_View_Helper_InfoLink, 'infoLink');
    $view->registerHelper(new Application_View_Helper_InfoData, 'infoData');
}

Now, I am passing some variables to layout (to Zend_View instance, as always), but layout doesn’t recognize that it has them.

When I move code which registers helpers, to init() method in controller, everything is ok. Is it ZF error or I did sth wrong?

  • 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-29T05:16:20+00:00Added an answer on May 29, 2026 at 5:16 am

    In Your Controller (or wherever you have view)

    $view->layout()->some_var = "Some Value";
    

    In Your Layout

    <?php echo $this->layout()->some_var; ?>
    

    if i’m missing some part of your question let me know.

    Edit: failing the above, the other correct way to do this would be to use the placeholder helper (http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.placeholder)

    Edit 2: Make sure you are bootstrapping view as well.

    $this->bootstrap('view');
    $view = $this->getResource('view');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to create a view from action method of some controller (right
If I create an controller method that returns ActionResult, then call View() at the
I was looking if Django had some kind of create_or_get method but it seems
I have this code to create table layout. In every row, had one OnclickListener
OK, here is how to re-create the problem had: Create a new project, using
I've had to create a custom membership provider for my current ASP .Net project
So I had to create this splash page in a very short amount of
If I had to create a content inventory for a website that doesn't have
For this assignment I had to create my own string class. I initially wrote
So basically the assignment was we had to create a doubly linked list that's

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.