Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2008, 06:08 PM
Junior Member
 
Join Date: Jan 2008
Posts: 1
Default zend_layout

Hi,

ok, call me stupid, but i dont get it.

in the controller action i use:
PHP Code:
$this->view->foo="bar" 
in the view script is
PHP Code:
echo $this->foo
in my layout template
PHP Code:
echo $this->layout()->content 
so far so fine. working like intended. BUT:
Zend Framework: Documentation reads:
Quote:
As an example, let's say your code first hits FooController::indexAction(), which renders some content to the default response segment, and then forwards to NavController::menuAction(), which renders content to the 'nav' response segment. Finally, you forward to CommentController::fetchAction() and fetch some comments, but render those to the default response segment as well (which appends content to that segment). Your view script could then render each separately:
ok i can have (in layout template)
PHP Code:
echo $this->layout()->nav 
but how is 'nav' be set ? i know of the way by setting "$this->getResponse()->append(). But so i can not include another action (like described in the doc). In my controller init i use
PHP Code:
$this->_helper->actionStack('menu','nav'); 
but the menu action would write to "default", how can it write to the 'nav response object' ?

TIA
Rufinus

Last edited by rufinus : 02-26-2008 at 06:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 06:25 AM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default

I am in the same boat as you, hopefully I will have it figured out by tomorrow and can write the results up if you haven't got it by now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-20-2008, 05:53 PM
Drakos7's Avatar
Junior Member
 
Join Date: May 2007
Location: MD, USA, Terra, Sol
Posts: 5
Default

One way to set 'nav' is like this:
$response = $this->getResponse();
$response->insert('nav', $this->view->render('nav.phtml'));
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-28-2008, 10:30 PM
Junior Member
 
Join Date: May 2008
Posts: 1
Default

Quote:
Originally Posted by rufinus View Post
Hi,
.. snip ..
PHP Code:
$this->_helper->actionStack('menu','nav'); 
but the menu action would write to "default", how can it write to the 'nav response object' ?
You can set the response segment for
PHP Code:
$this->layout()->nav 
by using:
PHP Code:
$this->_helper->viewRenderer->setResponseSegment('nav'); 
inside NavController::menuAction().
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:06 AM.