PHP Класс System\Route

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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