PHP Класс ManaPHP\Mvc\Dispatcher

Наследование: extends ManaPHP\Component, implements ManaPHP\Mvc\DispatcherInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_actionName string
$_controller Controller
$_controllerName string
$_finished boolean
$_forwarded boolean
$_initializedControllers array
$_moduleName string
$_params array
$_previousActionName string
$_previousControllerName string
$_returnedValue mixed

Открытые методы

Метод Описание
dispatch ( string $module, string $controller, string $action, array $params = [] ) : boolean Dispatches a handle action taking into account the routing parameters
forward ( string $forward, array $params = [] ) Forwards the execution flow to another controller/action Dispatchers are unique per module. Forwarding between modules is not allowed
getActionName ( ) : string Gets the latest dispatched action name
getController ( ) : Controller
getControllerName ( ) : string Gets last dispatched controller name
getModuleName ( ) : string Gets the module where the controller class is
getParam ( string | integer $param, string | array $filters = null, mixed $defaultValue = null ) : mixed Gets a param by its name or numeric index
getParams ( ) : array Gets action params
getPreviousActionName ( ) : string Returns the previous action in the dispatcher
getPreviousControllerName ( ) : string Returns the previous controller in the dispatcher
getReturnedValue ( ) : mixed Returns value returned by the latest dispatched action
hasParam ( string $param ) : boolean
setActionName ( string $actionName ) : static
setControllerName ( string $controllerName ) : static
setParams ( array $params, boolean $merge = true ) : static
setReturnedValue ( mixed $value ) : static Sets the latest returned value by an action manually
wasForwarded ( ) : boolean Check if the current executed action was forwarded by another one

Описание методов

dispatch() публичный Метод

Dispatches a handle action taking into account the routing parameters
public dispatch ( string $module, string $controller, string $action, array $params = [] ) : boolean
$module string
$controller string
$action string
$params array
Результат boolean

forward() публичный Метод

$this->dispatcher->forward('posts/index'));
public forward ( string $forward, array $params = [] )
$forward string
$params array

getActionName() публичный Метод

Gets the latest dispatched action name
public getActionName ( ) : string
Результат string

getController() публичный Метод

public getController ( ) : Controller
Результат Controller

getControllerName() публичный Метод

Gets last dispatched controller name
public getControllerName ( ) : string
Результат string

getModuleName() публичный Метод

Gets the module where the controller class is
public getModuleName ( ) : string
Результат string

getParam() публичный Метод

Gets a param by its name or numeric index
public getParam ( string | integer $param, string | array $filters = null, mixed $defaultValue = null ) : mixed
$param string | integer
$filters string | array
$defaultValue mixed
Результат mixed

getParams() публичный Метод

Gets action params
public getParams ( ) : array
Результат array

getPreviousActionName() публичный Метод

Returns the previous action in the dispatcher
public getPreviousActionName ( ) : string
Результат string

getPreviousControllerName() публичный Метод

Returns the previous controller in the dispatcher
public getPreviousControllerName ( ) : string
Результат string

getReturnedValue() публичный Метод

Returns value returned by the latest dispatched action
public getReturnedValue ( ) : mixed
Результат mixed

hasParam() публичный Метод

public hasParam ( string $param ) : boolean
$param string
Результат boolean

setActionName() публичный Метод

public setActionName ( string $actionName ) : static
$actionName string
Результат static

setControllerName() публичный Метод

public setControllerName ( string $controllerName ) : static
$controllerName string
Результат static

setParams() публичный Метод

public setParams ( array $params, boolean $merge = true ) : static
$params array
$merge boolean
Результат static

setReturnedValue() публичный Метод

Sets the latest returned value by an action manually
public setReturnedValue ( mixed $value ) : static
$value mixed
Результат static

wasForwarded() публичный Метод

Check if the current executed action was forwarded by another one
public wasForwarded ( ) : boolean
Результат boolean

Описание свойств

$_actionName защищенное свойство

protected string $_actionName
Результат string

$_controller защищенное свойство

protected Controller,ManaPHP\Mvc $_controller
Результат Controller

$_controllerName защищенное свойство

protected string $_controllerName
Результат string

$_finished защищенное свойство

protected bool $_finished
Результат boolean

$_forwarded защищенное свойство

protected bool $_forwarded
Результат boolean

$_initializedControllers защищенное свойство

protected array $_initializedControllers
Результат array

$_moduleName защищенное свойство

protected string $_moduleName
Результат string

$_params защищенное свойство

protected array $_params
Результат array

$_previousActionName защищенное свойство

protected string $_previousActionName
Результат string

$_previousControllerName защищенное свойство

protected string $_previousControllerName
Результат string

$_returnedValue защищенное свойство

protected mixed $_returnedValue
Результат mixed