-- Jim Pringle <[EMAIL PROTECTED]> wrote
(on Wednesday, 03 September 2008, 11:32 PM -0700):
> Been using Code Igniter for years and feeling out ZF. Just trying to figure 
> out
> how i can render a "view" into a variable so I can echo it out in the
> template.  Any thoughts?  Thanks!
> 
> This of course doesn't give me what I hope for:
> 
> $this->view->navbar = $this->render('navbar');

You want:

    $this->view->navbar = $this->view->render('navbar.phtml');

The action controller render() method  actually does three things: it
auto-determines the controller directory and view script suffix, it
defers rendering until action execution completion, and it captures the
content to the response object -- and it does this by simply providing
hinting to the ViewRenderer action helper, which does the actual work.

What you want is immediate execution and return of the render -- so you
want to call the render() method of the *view* object.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to