PHP 클래스 Bluz\Router\Router

저자: Anton Shevchuk
상속: use trait Bluz\Common\Options
파일 보기 프로젝트 열기: bluzphp/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$baseUrl base URL
$cleanUri REQUEST_URI minus Base URL
$defaultController default Controller
$defaultModule default module
$errorController error Controller
$errorModule error module
$params instance parameters
$rawParams instance raw parameters
$reverse reverse map
$routers routers map

공개 메소드들

메소드 설명
__construct ( ) Constructor of Router
getBaseUrl ( ) : string Get the base URL.
getCleanUri ( ) : string Get the request URI without baseUrl
getDefaultController ( ) : string Get default controller
getDefaultModule ( ) : string Get default module
getErrorController ( ) : string Get error controller
getErrorModule ( ) : string Get error module
getFullUrl ( string $module = self::DEFAULT_MODULE, string $controller = self::DEFAULT_CONTROLLER, array $params = [] ) : string Build full URL to controller
getParam ( string $key, mixed $default = null ) : mixed Get an action parameter
getParams ( ) : array Get parameters
getRawParams ( ) : array Get raw params, w/out module and controller
getUrl ( string $module = self::DEFAULT_MODULE, string $controller = self::DEFAULT_CONTROLLER, array $params = [] ) : string Build URL to controller
process ( ) : Router Process routing
setBaseUrl ( string $baseUrl ) : void Set the base URL.
setDefaultController ( string $defaultController ) : void Set default controller
setDefaultModule ( string $defaultModule ) : void Set default module
setErrorController ( string $errorController ) : void Set error controller
setErrorModule ( string $errorModule ) : void Set error module
setParam ( string $key, mixed $value ) : void Set an action parameter

보호된 메소드들

메소드 설명
processCustom ( ) : boolean Process custom router
processDefault ( ) : boolean Process default router
processRoute ( ) : boolean Process router by default rules
resetRequest ( ) : void Reset Request
urlCustom ( string $module, string $controller, array $params ) : string Build URL by custom route
urlRoute ( string $module, string $controller, array $params ) : string Build URL by default route

메소드 상세

__construct() 공개 메소드

Constructor of Router
public __construct ( )

getBaseUrl() 공개 메소드

Get the base URL.
public getBaseUrl ( ) : string
리턴 string

getCleanUri() 공개 메소드

Get the request URI without baseUrl
public getCleanUri ( ) : string
리턴 string

getDefaultController() 공개 메소드

Get default controller
public getDefaultController ( ) : string
리턴 string

getDefaultModule() 공개 메소드

Get default module
public getDefaultModule ( ) : string
리턴 string

getErrorController() 공개 메소드

Get error controller
public getErrorController ( ) : string
리턴 string

getErrorModule() 공개 메소드

Get error module
public getErrorModule ( ) : string
리턴 string

getFullUrl() 공개 메소드

Build full URL to controller
public getFullUrl ( string $module = self::DEFAULT_MODULE, string $controller = self::DEFAULT_CONTROLLER, array $params = [] ) : string
$module string
$controller string
$params array
리턴 string

getParam() 공개 메소드

Get an action parameter
public getParam ( string $key, mixed $default = null ) : mixed
$key string
$default mixed Default value to use if key not found
리턴 mixed

getParams() 공개 메소드

Get parameters
public getParams ( ) : array
리턴 array

getRawParams() 공개 메소드

Get raw params, w/out module and controller
public getRawParams ( ) : array
리턴 array

getUrl() 공개 메소드

Build URL to controller
public getUrl ( string $module = self::DEFAULT_MODULE, string $controller = self::DEFAULT_CONTROLLER, array $params = [] ) : string
$module string
$controller string
$params array
리턴 string

process() 공개 메소드

Process routing
public process ( ) : Router
리턴 Router

processCustom() 보호된 메소드

Process custom router
protected processCustom ( ) : boolean
리턴 boolean

processDefault() 보호된 메소드

Process default router
protected processDefault ( ) : boolean
리턴 boolean

processRoute() 보호된 메소드

Default routers examples :module/ :module/:controller/ :module/:controller/:key1/:value1/:key2/:value2...
protected processRoute ( ) : boolean
리턴 boolean

resetRequest() 보호된 메소드

Reset Request
protected resetRequest ( ) : void
리턴 void

setBaseUrl() 공개 메소드

Set the base URL.
public setBaseUrl ( string $baseUrl ) : void
$baseUrl string
리턴 void

setDefaultController() 공개 메소드

Set default controller
public setDefaultController ( string $defaultController ) : void
$defaultController string
리턴 void

setDefaultModule() 공개 메소드

Set default module
public setDefaultModule ( string $defaultModule ) : void
$defaultModule string
리턴 void

setErrorController() 공개 메소드

Set error controller
public setErrorController ( string $errorController ) : void
$errorController string
리턴 void

setErrorModule() 공개 메소드

Set error module
public setErrorModule ( string $errorModule ) : void
$errorModule string
리턴 void

setParam() 공개 메소드

A $value of null will unset the $key if it exists
public setParam ( string $key, mixed $value ) : void
$key string
$value mixed
리턴 void

urlCustom() 보호된 메소드

Build URL by custom route
protected urlCustom ( string $module, string $controller, array $params ) : string
$module string
$controller string
$params array
리턴 string

urlRoute() 보호된 메소드

Build URL by default route
protected urlRoute ( string $module, string $controller, array $params ) : string
$module string
$controller string
$params array
리턴 string

프로퍼티 상세

$baseUrl 보호되어 있는 프로퍼티

base URL
protected $baseUrl

$cleanUri 보호되어 있는 프로퍼티

REQUEST_URI minus Base URL
protected $cleanUri

$defaultController 보호되어 있는 프로퍼티

default Controller
protected $defaultController

$defaultModule 보호되어 있는 프로퍼티

default module
protected $defaultModule

$errorController 보호되어 있는 프로퍼티

error Controller
protected $errorController

$errorModule 보호되어 있는 프로퍼티

error module
protected $errorModule

$params 보호되어 있는 프로퍼티

instance parameters
protected $params

$rawParams 보호되어 있는 프로퍼티

instance raw parameters
protected $rawParams

$reverse 보호되어 있는 프로퍼티

reverse map
protected $reverse

$routers 보호되어 있는 프로퍼티

routers map
protected $routers