PHP Class Webiny\Component\Bootstrap\Dispatcher

Receives the callback data from the Router and issues the callback. Dispatcher works with standard MVC callback, or with a custom class based callback.
Inheritance: use trait Webiny\Component\StdLib\StdObjectTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
customDispatcher ( string $className, string $action, array $params ) : Dispatcher Creates a Dispatcher instance from a class name.
getAction ( ) : string Returns action name.
getClassName ( ) : string Returns the current class name.
getController ( ) : string Returns the controller name.
getModule ( ) : string Returns the module name.
getParams ( ) : array Returns the current list of parameters.
issueCallback ( ) Calls the defined action on the current class name, passing along the parameters.
mvcDispatcher ( string $module, string $controller, string $action, array $params ) : Dispatcher Creates a Dispatcher instance from MVC parameters.
setAction ( string $action ) Sets the action name.
setClassName ( string $className ) Sets the class name. Note, this will overwrite the current class name, also valid in case of MVC callback.
setController ( string $controller ) Sets the controller name.
setModule ( string $module ) Sets the module name.
setParams ( array $params ) Sets the callback parameters.

Private Methods

Méthode Description
getApplicationInstance ( ) : Application Create a new Application instance. The method also sets the current configuration and environment inside the Application instance.
getCallbackClassInstance ( ) : mixed Creates class instance from the defined class name.
setTemplate ( mixed $instance ) : boolean Tries to set the view template for the given $instance.

Method Details

customDispatcher() public static méthode

Creates a Dispatcher instance from a class name.
public static customDispatcher ( string $className, string $action, array $params ) : Dispatcher
$className string Fully qualified class name.
$action string Action name.
$params array Parameters.
Résultat Dispatcher

getAction() public méthode

Returns action name.
public getAction ( ) : string
Résultat string

getClassName() public méthode

Returns the current class name.
public getClassName ( ) : string
Résultat string

getController() public méthode

Returns the controller name.
public getController ( ) : string
Résultat string

getModule() public méthode

Returns the module name.
public getModule ( ) : string
Résultat string

getParams() public méthode

Returns the current list of parameters.
public getParams ( ) : array
Résultat array

issueCallback() public méthode

Calls the defined action on the current class name, passing along the parameters.
public issueCallback ( )

mvcDispatcher() public static méthode

Creates a Dispatcher instance from MVC parameters.
public static mvcDispatcher ( string $module, string $controller, string $action, array $params ) : Dispatcher
$module string Module name.
$controller string Controller name.
$action string Action name.
$params array Parameters.
Résultat Dispatcher

setAction() public méthode

Sets the action name.
public setAction ( string $action )
$action string Action name.

setClassName() public méthode

Sets the class name. Note, this will overwrite the current class name, also valid in case of MVC callback.
public setClassName ( string $className )
$className string Fully qualified class name.

setController() public méthode

Sets the controller name.
public setController ( string $controller )
$controller string Controller name.

setModule() public méthode

Sets the module name.
public setModule ( string $module )
$module string Module name.

setParams() public méthode

Sets the callback parameters.
public setParams ( array $params )
$params array List of parameters.