package Default

 Methods

Add a rendering strategy

addRenderingStrategy(callable $callable, integer $priority = 1) : \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

callable

$priority

integer

Returns

\Zend\View\View

Add a response strategy

addResponseStrategy(callable $callable, integer $priority = 1) : \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

callable

$priority

integer

Returns

\Zend\View\View

Retrieve the event manager instance

getEventManager() : \Zend\EventManager\EventManagerInterface

Lazy-loads a default instance if none available

Returns

\Zend\EventManager\EventManagerInterface

Get MVC request object

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

Returns

null\Zend\Stdlib\RequestInterface

Get MVC response object

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

Returns

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

$model

\Zend\View\Model\ModelInterface

Exceptions

\Zend\View\Exception\RuntimeException

Set the event manager instance

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

Parameters

$events

\Zend\EventManager\EventManagerInterface

Returns

\Zend\View\View

Set MVC request object

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

Parameters

$request

\Zend\Stdlib\RequestInterface

Returns

\Zend\View\View

Set MVC response object

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

Parameters

$response

\Zend\Stdlib\ResponseInterface

Returns

\Zend\View\View

Create and return ViewEvent used by render()

getEvent() : \Zend\View\ViewEvent

Returns

\Zend\View\ViewEvent

Loop through children, rendering each

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

Parameters

$model

\Zend\View\Model\ModelInterface

Exceptions

\Zend\View\Exception\DomainException

 Properties

 

$events

$events : \Zend\EventManager\EventManagerInterface

Default

 

$request

$request : \Zend\Stdlib\RequestInterface

Default

 

$response

$response : \Zend\Stdlib\ResponseInterface

Default