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
3
votes
2 answers

Adobe Reader cannot open .pdf file created using mPDF in Zend Framework

I'm trying to generate a .pdf file using mPDF in a Zend Framework application, from the output of the action. Here is the code of my action: public function testAction() { $this->_helper->viewRenderer->setNoRender(); …
Daniel
  • 667
  • 6
  • 19
2
votes
1 answer

Best way to show user info in zend layout

I'm trying to show information about user in my Zend Framework application. I'm using one layout script for all controllers (except login controller). And now I want to show information about logged in user (this layout is used only on controllers…
eater
  • 408
  • 3
  • 9
2
votes
1 answer

Where should I locate logic related to layout in Zend Framework?

I need to customize the attributes of my body tag. Where should I locate the logic? In a Base Controller, view Helper ? This should be the layout doctype() ?> ... …
texai
  • 3,696
  • 6
  • 31
  • 41
2
votes
1 answer

Set indent on view in Zend Framework

In Zend Framework, it is possible to set indentation for headMeta(), headLink(), etc: headLink()->setIndent("\t\t") ?> I like this. I like things tidy. So, now I would want to indent my entire view as well in the layout.phtml file,…
ANisus
  • 74,460
  • 29
  • 162
  • 158
2
votes
2 answers

How to setup multiple Layouts in Zend Framework. Eg. Public/Logged in/Various combinations of modules

I know & used the very basic Zend Framework's Layouts where I used 1 layout throughout the whole site. But now I need a more intermediate/organized setup. The public site layout will have the div#mainContent taking up the whole 12 columns (using…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
2
votes
3 answers

where is the appropriate place to put code to switch the Zend Layout being used?

I have created a Zend Framework website and I'm now updating it to switch out the layout file depending on whether or not the user is on a mobile device. I have written a class to deal with the detection but I don't know where is best to place this…
Andrew
  • 9,967
  • 10
  • 64
  • 103
2
votes
3 answers

Zend_Test_PHPUnit_ControllerTestCase and Zend_Layout, unable to find Layout plugin while running tests

I am starting to write some test cases for controller classes using Zend Framework 1.10.6 and Zend_Test_PHPUnit_ControllerTestCase. I am having problems with one item, which is that while the test cases are running,…
delatbabel
  • 3,601
  • 24
  • 29
2
votes
1 answer

Render a partial view with layout in Zend Framework 1.12

Similar questions have been asked before but unfortunately I am still not able to find a solution of my problem. I want to render a view with its layout and store its response into a variable. I have an action called pdf as shown below. public…
user5108430
2
votes
2 answers

How to move the "views" of Zend_Layout

Normally it would be in such a structure: ../application/modules/somemodule/views/scripts/index/index.phtml How I move it to: ../application/templates/somemodule/template1/views/...... ../application/templates/somemodule/templateTWOOMG/....... ??
y2k
  • 65,388
  • 27
  • 61
  • 86
2
votes
1 answer

Zf2 layout and authentication

I am building a ZF2 based site, and it has 2 different layouts. It has some public pages and some internal pages which require user authentication, each set of pages have their layouts. I was initially thinking of creating a controller plugin and…
2
votes
1 answer

Zend Navigation and RBAC

I am developing a ZF2 based site. I have a main navigation which stays same regardless of the visitor/user status. Need to add another component/nav, which will depend on the user's status and role. For a visitor the items will be Register Login EN…
M Hill
  • 225
  • 2
  • 6
2
votes
1 answer

how to append script file in zend framework

My layouts are placed inside layout/scripts/layout.phtml i have placed the below code inside my head section of layout.phtml headScript()->appendFile($this->baseUrl().'/js/jquery-1.7.2.min.js') …
rockstar
  • 1,322
  • 1
  • 20
  • 37
2
votes
2 answers

How capture the default.phtml in a variable inside a controller

I have a simple question... How could I render the contents of the default.phtml which is in Project/application/layouts/scripts/default.phtml to a variable, so I can have its html. In the index controller, with an action and a phtml file named…
Jack
  • 31
  • 7
1
vote
3 answers

Using Variables in layouts using Zend Framework

I am trying to learn how to use the Zend Framework and ive ran into trouble. Im trying to place the current users name in the header of the application (displayed on every page), specifically /layouts/scripts/default.phtml. The MVC architecture is…
1
vote
1 answer

Zend Layout for specific Actions

Is there a simple way of just enable a layout for the actions of a controller, instead of disabling it in all other actions of other controllers in Zend?