PHP 클래스 ManaPHP\Mvc\Dispatcher

상속: extends ManaPHP\Component, implements ManaPHP\Mvc\DispatcherInterface
파일 보기 프로젝트 열기: manaphp/manaphp

보호된 프로퍼티들

프로퍼티 타입 설명
$_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

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