PHP Class Zend\Mvc\Controller\Plugin\AcceptableViewModelSelector

Inheritance: extends Zend\Mvc\Controller\Plugin\AbstractPlugin
Afficher le fichier Open project: zendframework/zend-mvc

Protected Properties

Свойство Type Description
$defaultMatchAgainst Array Default array to match against.
$defaultViewModelName Default ViewModel
$event Zend\Mvc\MvcEvent
$request Zend\Http\Request

Méthodes publiques

Méthode Description
__invoke ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null Detects an appropriate viewmodel for request.
getDefaultMatchAgainst ( ) : array | null Get the default Accept Types and View Model combinations to match against if none are specified.
getDefaultViewModelName ( ) : string Set the default View Model (name) to return if no match could be made
getViewModel ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null Detects an appropriate viewmodel for request.
getViewModelName ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null Detects an appropriate viewmodel name for request.
match ( array $matchAgainst = null ) : Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null Detects an appropriate viewmodel name for request.
setDefaultMatchAgainst ( array $matchAgainst = null ) : AcceptableViewModelSelector Set the default Accept Types and View Model combinations to match against if none are specified.
setDefaultViewModelName ( string $defaultViewModelName ) : AcceptableViewModelSelector Set the default View Model (name) to return if no match could be made

Méthodes protégées

Méthode Description
extractViewModelName ( Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart $res ) : string Extract the viewmodel name from a match
getEvent ( ) : MvcEvent Get the event
getRequest ( ) : Zend\Http\Request Get the request
injectViewModelName ( string $modelAcceptString, string $modelName ) : string Inject the viewmodel name into the accept header string

Method Details

__invoke() public méthode

Detects an appropriate viewmodel for request.
public __invoke ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null
$matchAgainst array (optional) The Array to match against
$returnDefault boolean (optional) If no match is available. Return default instead
$resultReference Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null (optional) The object that was matched
Résultat Zend\View\Model\ModelInterface | null

extractViewModelName() protected méthode

Extract the viewmodel name from a match
protected extractViewModelName ( Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart $res ) : string
$res Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart
Résultat string

getDefaultMatchAgainst() public méthode

Get the default Accept Types and View Model combinations to match against if none are specified.
public getDefaultMatchAgainst ( ) : array | null
Résultat array | null

getDefaultViewModelName() public méthode

Set the default View Model (name) to return if no match could be made
public getDefaultViewModelName ( ) : string
Résultat string

getEvent() protected méthode

Get the event
protected getEvent ( ) : MvcEvent
Résultat Zend\Mvc\MvcEvent

getRequest() protected méthode

Get the request
protected getRequest ( ) : Zend\Http\Request
Résultat Zend\Http\Request

getViewModel() public méthode

Detects an appropriate viewmodel for request.
public getViewModel ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null
$matchAgainst array (optional) The Array to match against
$returnDefault boolean (optional) If no match is available. Return default instead
$resultReference Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null (optional) The object that was matched
Résultat Zend\View\Model\ModelInterface | null

getViewModelName() public méthode

Detects an appropriate viewmodel name for request.
public getViewModelName ( array $matchAgainst = null, boolean $returnDefault = true, Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null &$resultReference = null ) : Zend\View\Model\ModelInterface | null
$matchAgainst array (optional) The Array to match against
$returnDefault boolean (optional) If no match is available. Return default instead
$resultReference Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null (optional) The object that was matched.
Résultat Zend\View\Model\ModelInterface | null Returns null if $returnDefault = false and no match could be made

injectViewModelName() protected méthode

Inject the viewmodel name into the accept header string
protected injectViewModelName ( string $modelAcceptString, string $modelName ) : string
$modelAcceptString string
$modelName string
Résultat string

match() public méthode

Detects an appropriate viewmodel name for request.
public match ( array $matchAgainst = null ) : Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null
$matchAgainst array (optional) The Array to match against
Résultat Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart | null The object that was matched

setDefaultMatchAgainst() public méthode

Set the default Accept Types and View Model combinations to match against if none are specified.
public setDefaultMatchAgainst ( array $matchAgainst = null ) : AcceptableViewModelSelector
$matchAgainst array (optional) The Array to match against
Résultat AcceptableViewModelSelector provides fluent interface

setDefaultViewModelName() public méthode

Set the default View Model (name) to return if no match could be made
public setDefaultViewModelName ( string $defaultViewModelName ) : AcceptableViewModelSelector
$defaultViewModelName string The default View Model name
Résultat AcceptableViewModelSelector provides fluent interface

Property Details

$defaultMatchAgainst protected_oe property

Default array to match against.
protected Array $defaultMatchAgainst
Résultat Array

$defaultViewModelName protected_oe property

Default ViewModel
protected $defaultViewModelName

$event protected_oe property

protected MvcEvent,Zend\Mvc $event
Résultat Zend\Mvc\MvcEvent

$request protected_oe property

protected Request,Zend\Http $request
Résultat Zend\Http\Request