I have an "EventsController" with an action "list"...at the end of the action, I have an actionstack with different actions from the "SideboxController"...
SideBox controller has an init() function which looks like this:
public function init() {
$this->render(null, 'sideboxes');
}
Which I was hoping would output all actions from this controller into the sideboxes segment.
It seemed to work in my layout script, but in the view script (events/list.phtml) I have <?=Zend_Controller_Front::getInstance()->getResponse()->getBody('sideboxes');?>
...which doesn't display anything!
On Wed, Nov 26, 2008 at 10:57 AM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Avi Block <atblock@gmail.com> wrote
(on Wednesday, 26 November 2008, 07:40 AM -0800):
>Grab it from the response object:
> How do I access a named response segment in a view script which is not my
> layout script?
> I have a couple of pages within my layout that have a sidebar themselves,
> and i'm trying to render to that sidebar using an actionstack.
$response = Zend_Controller_Front::getInstance()->getResponse();
$content = $response->getBody($segmentName);
Matthew Weier O'Phinney
> Alternatively, I would like to do this via a "sublayout"...but I can't
> figure out how to render a layout within another layout.
--
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论