category Zend
package Zend_View

 Methods

Add a rendering strategy

addRenderingStrategy(\Zend\View\callable $callable, int $priority) : \Zend\View\View

Expects a callable. Strategies should accept a ViewEvent object, and should return a Renderer instance if the strategy is selected.

Internally, the callable provided will be subscribed to the "renderer" event, at the priority specified.

Parameters

$callable

\Zend\View\callable

$priority

int

Returns

Add a response strategy

addResponseStrategy(\Zend\View\callable $callable, int $priority) : \Zend\View\View

Expects a callable. Strategies should accept a ViewEvent object. The return value will be ignored.

Typical usages for a response strategy are to populate the Response object.

Internally, the callable provided will be subscribed to the "response" event, at the priority specified.

Parameters

$callable

\Zend\View\callable

$priority

int

Returns

Retrieve the event manager instance

getEventManager() : \Zend\EventManager\EventManagerInterface

Lazy-loads a default instance if none available

Returns

Get MVC request object

getRequest() : null | \Zend\Stdlib\RequestInterface

Get MVC response object

getResponse() : null | \Zend\Stdlib\ResponseInterface

Render the provided model.

render(\Zend\View\Model\ModelInterface $model) : void

Internally, the following workflow is used:

  • Trigger the "renderer" event to select a renderer.
  • Call the selected renderer with the provided Model
  • Trigger the "response" event

triggers renderer(ViewEvent)
triggers response(ViewEvent)

Parameters

Exceptions

\Zend\View\Exception\RuntimeException

Set the event manager instance

setEventManager(\Zend\EventManager\EventManagerInterface $events) : \Zend\View\View

Set MVC request object

setRequest(\Zend\Stdlib\RequestInterface $request) : \Zend\View\View

Parameters

Returns

Set MVC response object

setResponse(\Zend\Stdlib\ResponseInterface $response) : \Zend\View\View

Parameters

Returns

Create and return ViewEvent used by render()

getEvent() : \Zend\View\ViewEvent

Loop through children, rendering each

renderChildren(\Zend\View\Model\ModelInterface $model) : void

 Properties

   

$request

$request : \Zend\Stdlib\RequestInterface

 

$response

$response : \Zend\Stdlib\ResponseInterface