Fully Qualified Name: | Zend\Mvc\Controller\Plugin\AcceptableViewModelSelector |
Extends: | AbstractPlugin |
Controller Plugin to assist in selecting an appropriate View Model type based on the User Agent's accept header.
Name | Description | Defined By |
---|---|---|
__invoke() | Detects an appropriate viewmodel for request. | AcceptableViewModelSelector |
getController() | Get the current controller instance | AbstractPlugin |
getDefaultMatchAgainst() | Get the default Accept Types and View Model combinations to match against if none are specified. | AcceptableViewModelSelector |
getDefaultViewModelName() | Set the default View Model (name) to return if no match could be made | AcceptableViewModelSelector |
getViewModel() | Detects an appropriate viewmodel for request. | AcceptableViewModelSelector |
getViewModelName() | Detects an appropriate viewmodel name for request. | AcceptableViewModelSelector |
match() | Detects an appropriate viewmodel name for request. | AcceptableViewModelSelector |
setController() | Set the current controller instance | AbstractPlugin |
setDefaultMatchAgainst() | Set the default Accept Types and View Model combinations to match against if none are specified. | AcceptableViewModelSelector |
setDefaultViewModelName() | Set the default View Model (name) to return if no match could be made | AcceptableViewModelSelector |
Detects an appropriate viewmodel for request.
Parameter Name | Type | Description |
---|---|---|
$matchAgainst | array | (optional) |
$returnDefault | bool | (optional) |
$resultReference | \AbstractFieldValuePart|null | (optional) |
Returns: \ModelInterface|null
Get the current controller instance
Returns: null|\Dispatchable
Get the default Accept Types and View Model combinations to match against if none are specified.
Returns: array|null
Set the default View Model (name) to return if no match could be made
Returns: string
Detects an appropriate viewmodel for request.
Parameter Name | Type | Description |
---|---|---|
$matchAgainst | array | (optional) |
$returnDefault | bool | (optional) |
$resultReference | \AbstractFieldValuePart|null | (optional) |
Returns: \ModelInterface|null
Detects an appropriate viewmodel name for request.
Parameter Name | Type | Description |
---|---|---|
$matchAgainst | array | (optional) |
$returnDefault | bool | (optional) |
$resultReference | \AbstractFieldValuePart|null | (optional) |
Returns: \ModelInterface|null Returns null if $returnDefault = false and no match could be made
Detects an appropriate viewmodel name for request.
Parameter Name | Type | Description |
---|---|---|
$matchAgainst | array | (optional) |
Returns: \AbstractFieldValuePart|null The object that was matched
Set the current controller instance
Parameter Name | Type | Description |
---|---|---|
$controller | \Dispatchable |
Returns: void
Set the default Accept Types and View Model combinations to match against if none are specified.
Parameter Name | Type | Description |
---|---|---|
$matchAgainst | array | (optional) |
Returns: \AcceptableViewModelSelector provides fluent interface
Set the default View Model (name) to return if no match could be made
Parameter Name | Type | Description |
---|---|---|
$defaultViewModelName | string | The |
Returns: \AcceptableViewModelSelector provides fluent interface