Controller Plugin to assist in selecting an appropriate View Model type based on the User Agent’s accept header.
Detects an appropriate viewmodel for request.
Parameters: |
|
---|---|
Throws InvalidArgumentException: | |
If the supplied and matched View Model could not be found |
|
Return type: | ModelInterface|null |
Detects an appropriate viewmodel for request.
Parameters: |
|
---|---|
Throws InvalidArgumentException: | |
If the supplied and matched View Model could not be found |
|
Return type: | ModelInterface|null |
Detects an appropriate viewmodel name for request.
Parameters: |
|
---|---|
Return type: | ModelInterface|null Returns null if $returnDefault = false and no match could be made |
Detects an appropriate viewmodel name for request.
Parameters: | array – (optional) The Array to match against |
---|---|
Return type: | AbstractFieldValuePart|null The object that was matched |
Set the default View Model (name) to return if no match could be made
Parameters: | string – The default View Model name |
---|---|
Return type: | AcceptableViewModelSelector provides fluent interface |
Set the default View Model (name) to return if no match could be made
Return type: | string |
---|
Set the default Accept Types and View Model combinations to match against if none are specified.
Parameters: | array – (optional) The Array to match against |
---|---|
Return type: | AcceptableViewModelSelector provides fluent interface |
Get the default Accept Types and View Model combinations to match against if none are specified.
Return type: | array|null |
---|
Inject the viewmodel name into the accept header string
Parameters: |
|
---|---|
Return type: | string |
Extract the viewmodel name from a match
Parameters: | AbstractFieldValuePart – |
---|---|
Return type: | string |