Questions tagged [zend-layout]

Zend_Layout: Part of the Zend Framework that combines the ideas behind Composite view and Two Step View

There are two design patterns that Zend Framework uses to implement layouts: » Two Step View and » Composite View. Two Step View is usually associated with the » Transform View pattern; the basic idea is that your application view creates a representation that is then injected into the master view for final transformation. The Composite View pattern deals with a view made of one or more atomic, application views.

In Zend Framework, Zend_Layout combines the ideas behind these patterns. Instead of each action view script needing to include site-wide artifacts, they can simply focus on their own responsibilities.

Source

82 questions
1
vote
1 answer

Cannot echo headTitle in layout view

I got my headTitle up running, except i cannot echo it in my layout file as i need it for page header. This is how i done it: Bootstrap.php: protected function _initDefaultHelpers() { $this->bootstrap('view'); $view =…
JavaCake
  • 4,075
  • 14
  • 62
  • 125
1
vote
4 answers

Which is better approach to get Zend_View

I am working on a Zend Framework based app, and in controller plugins, I can get Zend_View object with the following methods, someone please tell me which approach is better and why? $view = Zend_Layout::getMvcInstance()->getView(); or …
Bryan
  • 645
  • 1
  • 6
  • 18
1
vote
1 answer

unable to access zend views from controller file

I am able to print the form content in the controller file, but when I assign the form view as $this->view->form = $form and trying to display the form design using echo $this->form in login.phtml file, form design is not viewed, instead displaying…
1
vote
1 answer

Zend Framework - use a common header for different actions in a controller?

I've tried reading the question found HERE: Module configuration and layout configuration in zend framework It was described as being everything I need to know about layouts - but - I'm afraid I'm finding it a bit difficult to understand. I've got…
Alex C
  • 16,624
  • 18
  • 66
  • 98
1
vote
1 answer

How get Zend_Controller_Plugin_Abstract redirect worked with full url change?it's making Zend_layout disable layout fail

I have an admin webapp.one have to login before perfoming any action.Now the /default/index/index has the login form which is an ExtJs component.basically the login process is an ajax one.i've created a plugin to disable the rendering and layout and…
black sensei
  • 6,528
  • 22
  • 109
  • 188
1
vote
2 answers

how to call and pass array data to layout from controller in zend 2?

Here is my Code, how to and pass data from controller to layout $arr = array(); $arr['layout'] = 'example'; $this->layout()->calllayout = $arr;
1
vote
2 answers

Where to put code required by the layout in Zend Framework?

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…
Wookai
  • 20,883
  • 16
  • 73
  • 86
1
vote
2 answers

how to create header in zf2's layout file

In layout file I want to create a header like the all website has .I have an image for the header how can I put that image only for the header portion of the page in layout File? this is my Code..
Bhavik Joshi
  • 2,557
  • 6
  • 24
  • 48
1
vote
0 answers

How can I inject additional child view into layout, that modules can override?

In my layout I would like an additional child view to render a menu. So in my layout I have; menu; ?> Then in my config under the view manager template_map key I have; 'navigation/menu' => __DIR__ .…
srayner
  • 1,799
  • 4
  • 23
  • 39
1
vote
0 answers

Override of Zend_View_Helper not being picked up in Zend_Layout

TL;DR: In ZF1, after registering a custom prefix in application.ini, the Zend_View_Helper_* namespace takes precedence over my own despite working correctly in regular views. Created an override of Zend_View_Helper_Url, called…
kander
  • 4,226
  • 1
  • 22
  • 43
1
vote
1 answer

Placement of conditional script in head section of a layout

In my layout I am using bunch of JavaScripts. Two of these scripts are conditional and they should only be loaded for IE9. And the remaining one should be loaded for all browsers. To achieve this I have done following in my Bootstrap class.…
Jay Bhatt
  • 5,601
  • 5
  • 40
  • 62
1
vote
1 answer

Zend Framework - Last Code to Execute Before Layout is Rendered

I want to execute some code right before the layout is rendered, after all other code is executed. Where would I put that code? I am specifically trying to modify the files referenced in the headLink, headScript, and inlineScript view helpers…
Sonny
  • 8,204
  • 7
  • 63
  • 134
1
vote
3 answers

how to switch to other layout in zend framework?

if i have 2 layout in my application how can change my default layout to other layout for some controller or action?
ulduz114
  • 1,150
  • 6
  • 21
  • 37
1
vote
1 answer

PHP: Zend_Layout: Where to write business logic?

On most project I use multiple layout scripts. Sometimes I need some data in my layouts that are layout-specific, instead of page-specific. Which layout gets used though, IS page-specific. So the bootstrap or actioncontroller would be good places to…
Maurice
  • 4,829
  • 7
  • 41
  • 50
1
vote
2 answers

Add scripts to overall layout from within a controller

I'm using Zend_view/Zend_Layout but i want to be able to append scripts to the overall template depending on the controller, so within the controller i could do something like: public function someAction() { …
robjmills
  • 18,438
  • 15
  • 77
  • 121