PHP 클래스 System\Route

파일 보기 프로젝트 열기: rwarasaurus/nano 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$args array The collected arguments from the uri match
$callbacks array Array of callable functions
$collection array Array of collection actions

공개 메소드들

메소드 설명
__callStatic ( $method, $arguments ) Define a route using the method name as the request method to listen for
__construct ( $callbacks, $args = [] ) Create a new instance of the Route class
action ( $name, $callback ) Register a action on the router
after ( $response ) : object | null Calls after actions
before ( ) : object | null Calls before actions
callback ( $name ) : object | null Run actions
collection ( $actions, $definitions ) Start a collection of routes with common actions
not_found ( $callbacks ) Register the 404 not found callback
register ( $method, $patterns, $arguments ) Register a route on the router
run ( ) : object Calls the route actions and returns a response object

메소드 상세

__callStatic() 공개 정적인 메소드

Define a route using the method name as the request method to listen for
public static __callStatic ( $method, $arguments )

__construct() 공개 메소드

Create a new instance of the Route class
public __construct ( $callbacks, $args = [] )

action() 공개 정적인 메소드

Register a action on the router
public static action ( $name, $callback )

after() 공개 메소드

Calls after actions
public after ( $response ) : object | null
리턴 object | null

before() 공개 메소드

Calls before actions
public before ( ) : object | null
리턴 object | null

callback() 공개 메소드

Run actions
public callback ( $name ) : object | null
리턴 object | null

collection() 공개 정적인 메소드

Start a collection of routes with common actions
public static collection ( $actions, $definitions )

not_found() 공개 정적인 메소드

Register the 404 not found callback
public static not_found ( $callbacks )

register() 공개 정적인 메소드

Register a route on the router
public static register ( $method, $patterns, $arguments )

run() 공개 메소드

Calls the route actions and returns a response object
public run ( ) : object
리턴 object

프로퍼티 상세

$args 공개적으로 프로퍼티

The collected arguments from the uri match
public array $args
리턴 array

$callbacks 공개적으로 프로퍼티

Array of callable functions
public array $callbacks
리턴 array

$collection 공개적으로 정적으로 프로퍼티

Array of collection actions
public static array $collection
리턴 array