Fully Qualified Name: | Laminas\View\View |
Implements: | EventManagerAwareInterface |
Name | Description | Defined By |
---|---|---|
addRenderingStrategy() | Add a rendering strategy | View |
addResponseStrategy() | Add a response strategy | View |
getEventManager() | Retrieve the event manager instance | View |
getRequest() | Get MVC request object | View |
getResponse() | Get MVC response object | View |
render() | Render the provided model. | View |
setEventManager() | Set the event manager instance | View |
setRequest() | Set MVC request object | View |
setResponse() | Set MVC response object | View |
Add a rendering strategy
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.
Parameter Name | Type | Description |
---|---|---|
$callable | callable | |
$priority | int |
Returns: \View
Add a response strategy
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.
Parameter Name | Type | Description |
---|---|---|
$callable | callable | |
$priority | int |
Returns: \View
Retrieve the event manager instance
Lazy-loads a default instance if none available
Returns: \EventManagerInterface
Get MVC request object
Returns: null|\Request
Get MVC response object
Returns: null|\Response
Render the provided model.
Internally, the following workflow is used:
Parameter Name | Type | Description |
---|---|---|
$model | \Model |
Returns: void
Set the event manager instance
Parameter Name | Type | Description |
---|---|---|
$events | \EventManagerInterface |
Returns: \View
Set MVC request object
Parameter Name | Type | Description |
---|---|---|
$request | \Request |
Returns: \View
Set MVC response object
Parameter Name | Type | Description |
---|---|---|
$response | \Response |
Returns: \View