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

How to switch layout files in Zend Framework?

I'm sure it's a simple one-liner, but I can't seem to find it. How can I use a different layout file for a particular action? Update: This worked for me, thanks! // Within controller $this->_helper->_layout->setLayout('other-layout')…
Andrew
  • 227,796
  • 193
  • 515
  • 708
17
votes
4 answers

How do I include header and footer with layout in Zend Framework?

I would like to let Zend_Layout include header.phtml and footer.phtml with [layouy name].phtml. How do I do that? I tried to read codes in Zend_Layout, Zend_Layout_Controller_Plugin_Layout. I still can't figure out it..
Moon
  • 22,195
  • 68
  • 188
  • 269
15
votes
3 answers

Zend - how to disable layout on a given action?

I have the following controller that, among other methods it has this one: class EquipasController extends OccControllerAction { public function listaAction() { $this->_helper->viewRenderer->setNoRender(true); …
MEM
  • 30,529
  • 42
  • 121
  • 191
11
votes
6 answers

Getting basepath from view in zend framework

Case: you're developing a site with Zend Framework and need relative links to the folder the webapp is deployed in. I.e. mysite.com/folder online and localhost:8080 under development. The following works nice in controllers regardless of deployed…
Mads Mobæk
  • 34,762
  • 20
  • 71
  • 78
11
votes
3 answers

Zend Framework - Set No Layout for Controller

I have a Controller that I want to use for ajax scripts to call and set session variables, get information, etc. How do I set it so that that particular controller doesn't use the default layout (specifically NO layout) so that it can send XML/JSON…
ashurexm
  • 6,209
  • 3
  • 45
  • 69
9
votes
5 answers

How to change meta tags in zend framework layout

So I have some default meta tags on layout.phtml set using $this->headTitle() and $this->headMeta()->appendName() and is echoed at layout.phtml's header My question is: How do I change those default meta tags from the view file such that they are…
kamikaze_pilot
  • 14,304
  • 35
  • 111
  • 171
5
votes
4 answers

How to use a Zend Layout as Wordpress Theme?

I have written a Zend application and have included Wordpress for blogging. When I first installed Wordpress I themed it so that it used the same header etc as the main application. I have since redone the main theme twice and had to redo the…
5
votes
3 answers

How can I populate Zend_Layout variables with backend data?

When trying to adhere to established best practices like avoiding singletons, registry, static properties and base controllers, how I can populate my layout(and partials used by the layout) with data that is only used by the layout and common across…
André Roaldseth
  • 550
  • 1
  • 4
  • 10
3
votes
1 answer

Zend Framework - clear a custom placeholder from a viewscript

I'm trying to clear a custom placeholder from a viewscript, let's say I have a controller plugin that creates a sidebar: $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap'); $view = $bootstrap->getResource('view'); …
Dr. Dre
  • 149
  • 2
  • 10
3
votes
3 answers

Zend MVC:: How can javascript file + javascript code inserted to partial for head or body area?

How can javascript file + javascript code inserted to partial for head or body area? [Inside view simply call for insert to head to HeadScript and to body InlineScript - this not works inside partial(If I am wrong please write). ] Thanks, Yosef
Ben
  • 25,389
  • 34
  • 109
  • 165
3
votes
2 answers

Zend_Layout and/or Smarty

I am new to Zend Framework, but planning to create quite a complex project using it. I was looking at the view options for Zend Framework. There is one with Zend_View and Zend_Layout and also template engines like Smarty can be integrated with…
Nandini Bhaduri
  • 1,835
  • 4
  • 18
  • 31
3
votes
4 answers

Can i have multiple layouts in Zend Framework?

I have a flashy page with image rotators in the front end for the clients. For back-end I want to have different layout. Can i have multiple layout? A little hint would be appreciable
S L
  • 14,262
  • 17
  • 77
  • 116
3
votes
1 answer

Zend_Dojo_Form in a layout

I have a Zend_Dojo_Form which I have moved from my view (where it works fine) to my layout, as it's something that will be useful on every page. However in the layout the form no longer works - none of the dijit elements appear and it behaves just…
Tim Fountain
  • 33,093
  • 5
  • 41
  • 69
3
votes
2 answers

How to use a layout for emails in Zend Framework

I would like to use a layout for the emails I'm sending out. I'm currently usine Zend Layout for the web pages, but would like to theme my emails as well. Here is what I've tried. This is my function that sends the email $layout =…
Shane Stillwell
  • 3,198
  • 5
  • 31
  • 53
3
votes
3 answers

How do I access Layout object in Zend Framework plugin?

I am trying to use a layout for each actions in a controller. For example, I have three actions in index controller. Those are indexAction, testAction, and welcomeAction. I created three xml layout files. index.xml, test.xml, and welcome.xml.…
Moon
  • 22,195
  • 68
  • 188
  • 269
1
2 3 4 5 6