zend-layout

Zend_Layout display Login or Navigation

Hi, iam not sure if iam doing it the right way. My Goal is to display in my Layout an Login or an Navigation at the header section. My implementation looks like this (without logic): 2 Layout scripts: login.phtml navigation.phtml An FrontController Plugin: class Plugin_Header extends Zend_Controller_Plugin_Abstract { /**...

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') //other-layout.phtml //Within view script <?php $this->layout()->setLayout('other-layout'); ?> ...

How do I access Layout object in Zend Framework plugin?

Hi, 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. Finally, I created a plugin. class Moon_Layout_Append extends Zend_Controller_Plugin_Abstr...

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

Hi, 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.. ...

Zend Layout - A "Smart" layout selector

I currently have Zend setup to look for a layout script in each module's view/scripts/layout.phtml file (ie: /application/modules/moduleName/scripts/layout.phtml). This is by setting layout[] to nothing (blank) in the application.ini file (resources.layout[] = ) The issue is that many modules may share the same layout. I don't want to...

Zend MVC - I echo some test debug output but it seems to be suppresed and does not show

I am developing a Zend MVC application. Sometimes I like to echo some text just for quick and dirty debugging. e.g <?php class MyClass {} echo('hello world - yes this script is included'); I can echo 'debug-text' in my bootstrap> But, when text is echoed in my model or controllers it is NOT being rendered in the output. I am using Z...

Add scripts to overall layout from within a controller

Hi, 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() { $something->headScript()->appendFile('script.js','text/javascript'); // etc etc } I have enabled Zend_view/Zend_Lay...

PHP: Zend_Layout: Where to write business logic?

Hi, 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 select a layout. But IMHO they would not be good places to inject the data a parti...

Using actionHelper without returning layout in output

I call an action helper in one of my views using the following code echo $this->action('foo', 'bar'); The fooAction in the barController does its thing and outputs a list of pages. However, the list has the layout in the output again, which is mightily irritating. If I disable the layout in the fooAction, this causes layout to be comp...

how to switch to other layout in zend framework?

hi if i have 2 layout in my application how can change my default layout to other layout for some controller or action? ...

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 before they're used by the layout. Here are the steps I want to take: Loop over the files i...

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/....... ?? ...

Zend disableLayout() leaves html & body tags in output

Hi all, could anyone take a look at this for me? Problem: trying to output a csv on demand using Zend Framework. I want to avoid creating files on the system so I'm trying to use the same solution posted here: http://stackoverflow.com/questions/1136264/export-csv-in-zend-framework However - I'm getting 3 blank lines in the csv (and i...

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 = Zend_Layout::getMvcInstance(); $this->_view->render($template); $html = $layout->render('emai...

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, Zend_Controller_Action_HelperBroker can't find the Layout action helper. Here are the bare bones of my test case: requir...

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 cleanest way to go. I saw people using plugins, but I don't think this is the way I want ...

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 as a normal HTML form would. Here's the relevant part of my bootstrap: protected functio...