-- till <[EMAIL PROTECTED]> wrote
(on Thursday, 31 May 2007, 06:03 PM +0200):
> On 5/31/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> > (...)
> > No need to grab the view. All you need is this:
> >
> > public function indexAction()
> > {
> > $this->view->books = array('Pride and Prejudice','Das
> > Kapital','Beyond Good and Evil');
> > }
>
> Since when has $this->view been available? I remember I was looking
> for something like that when we started (0.6).
Basic view integration was originally released in 0.9.2, on 6 April
2007, but had been in subversion for some weeks prior to that.
In this latest release, we introduced the ViewRenderer, an action helper
which is on by default, and which populates the view object in the
controller (as well as autorenders templates during postDispatch()).
Please read the changelog (http://framework.zend.com/changelog) as well
as the Zend_Controller migration notes
(http://framework.zend.com/manual/en/zend.controller.migration.html) for
more information.
> Also, it seems like there are different variables available, like
> $this->_request, $this->view - "_" always hints at private, or is
> their any special meaning/naming convention here?
Most properties in Zend_Controller_Action are protected and have public
accessor methods for modifying and retrieving them. However, from the
beginning, I felt the view property should be something that could be
injected without intervention of an accessor; this has made creating the
ViewRenderer a trivial task, as it didn't need additional accessors in
the action controller in order to do its work.
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/