compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (9)

View Page History

{cloak:id=MVCViewObject}
By default, ZF uses an action helper called the ViewRenderer. This action helper instantiates and stores a Zend_View object which is injected into various other objects. To get the ViewRenderer, pull it from the Action Helper broker:
ZF uses an action helper called the ViewRenderer by default. This action helper instantiates and stores a Zend_View object, which is subsequently injected into other objects. The view object is stored in the ViewRenderer's view property. You can get the ViewRenderer instance, and thereby the view instance, with the Action Helper broker:

{code:php}
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
{code}

The view object is stored in the ViewRenderer's view property:

{code:php}
$view = $viewRenderer->view;
{code}

However, if you're grabbing accessing the view early in the dispatch process- before an action is actually dispatched, for example- then you may need to initialize the view first:

{code:php}
{code}

The view can also be obtained via the layout object. If you are using and have already initialized Zend_Layout, you can get at the view object much more succinctly:
If you are using and have already initialized Zend_Layout, you can access the view object much more succinctly:

{code:php}
{code}

This actually proxies to the ViewRenderer, and does all of the above steps for you.
This proxies to the ViewRenderer and performs all of the steps above for you.
{cloak}