PHP Класс Ouzo\Routing\Route

Sample usage: Route::get('/agents/index', 'agents#index'); will match: GET /agents/index Route::post('/agents/save', 'agents#save'); will match: POST /agents/save Route::resource('agents'); will mapping RESTs methods (index, fresh, edit, show, create, update, destroy) Route::any('/agents/show_numbers', 'agents#show_numbers'); will match: POST or GET /agents/show_numbers Route::allowAll('/agents', 'agents'); will mapping any methods to all actions in controller To show all routes or routes per controller: Route::getRoutes(); Route::getRoutesForController('agents');
Наследование: implements Ouzo\Routing\RouteInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$isDebug
$methods
$validate

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

Метод Описание
allowAll ( $uri, $controller, $options = [] )
any ( $uri, $action, array $options = [] )
clear ( )
delete ( $uri, $action, array $options = [] )
get ( $uri, $action, array $options = [] )
getRoutes ( ) : RouteRule[]
getRoutesForController ( $controller )
group ( $name, $routeFunction )
post ( $uri, $action, array $options = [] )
put ( $uri, $action, array $options = [] )
resource ( $controller )

Приватные методы

Метод Описание
addResourceRoute ( $controller, $method, $uriSuffix, $action )
addRoute ( $method, $uri, $action, $requireAction = true, $options = [], $isResource = false )
createRouteAction ( $controller, $action )
createRouteUri ( $action, $suffix = '' )
existRouteRule ( $methods, $uri )

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

allowAll() публичный статический метод

public static allowAll ( $uri, $controller, $options = [] )

any() публичный статический метод

public static any ( $uri, $action, array $options = [] )
$options array

clear() публичный статический метод

public static clear ( )

delete() публичный статический метод

public static delete ( $uri, $action, array $options = [] )
$options array

get() публичный статический метод

public static get ( $uri, $action, array $options = [] )
$options array

getRoutes() публичный статический метод

public static getRoutes ( ) : RouteRule[]
Результат RouteRule[]

getRoutesForController() публичный статический метод

public static getRoutesForController ( $controller )

group() публичный статический метод

public static group ( $name, $routeFunction )

post() публичный статический метод

public static post ( $uri, $action, array $options = [] )
$options array

put() публичный статический метод

public static put ( $uri, $action, array $options = [] )
$options array

resource() публичный статический метод

public static resource ( $controller )

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

$isDebug публичное статическое свойство

public static $isDebug

$methods публичное статическое свойство

public static $methods

$validate публичное статическое свойство

public static $validate