Zend\Mvc\Controller\Plugin\AcceptableViewModelSelector::getViewModel
Detects an appropriate viewmodel for request.
Signature
public function getViewModel([array
$matchAgainst = null,
[bool&
$returnDefault = true,
[AbstractFieldValuePart|null&
$resultReference = null]]] )
Parameters
$matchAgainst
— array- (optional) The Array to match against
$returnDefault
— object- (optional) If no match is available. Return default instead
$resultReference
— object- (optional) The object that was matched
Returns
- ModelInterface|null
Errors/Exceptions
-
InvalidArgumentException
- If the supplied and matched View Model could not be found