PHP Класс ManaPHP\Mvc\Router\Group

Наследование: extends ManaPHP\Component, implements ManaPHP\Mvc\Router\GroupInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_routes ManaPHP\Mvc\Router\RouteInterface[]
$_useDefaultRoutes boolean

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

Метод Описание
__construct ( boolean $useDefaultRoutes = true ) Group constructor.
add ( string $pattern, string | array $paths = null, string | array $httpMethod = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router on any HTTP method
addDelete ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is DELETE
addGet ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is GET
addHead ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is HEAD
addOptions ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Add a route to the router that only match if the HTTP method is OPTIONS
addPatch ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is PATCH
addPost ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is POST
addPut ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route to the router that only match if the HTTP method is PUT
match ( string $uri ) : array | false

Защищенные методы

Метод Описание
_addRoute ( string $pattern, string | array $paths = null, string $httpMethod = null ) : ManaPHP\Mvc\Router\RouteInterface Adds a route applying the common attributes

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

__construct() публичный Метод

Group constructor.
public __construct ( boolean $useDefaultRoutes = true )
$useDefaultRoutes boolean

_addRoute() защищенный Метод

Adds a route applying the common attributes
protected _addRoute ( string $pattern, string | array $paths = null, string $httpMethod = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
$httpMethod string
Результат ManaPHP\Mvc\Router\RouteInterface

add() публичный Метод

$router->add('/about', 'About::index');
public add ( string $pattern, string | array $paths = null, string | array $httpMethod = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
$httpMethod string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addDelete() публичный Метод

Adds a route to the router that only match if the HTTP method is DELETE
public addDelete ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addGet() публичный Метод

Adds a route to the router that only match if the HTTP method is GET
public addGet ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addHead() публичный Метод

Adds a route to the router that only match if the HTTP method is HEAD
public addHead ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addOptions() публичный Метод

Add a route to the router that only match if the HTTP method is OPTIONS
public addOptions ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addPatch() публичный Метод

Adds a route to the router that only match if the HTTP method is PATCH
public addPatch ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addPost() публичный Метод

Adds a route to the router that only match if the HTTP method is POST
public addPost ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

addPut() публичный Метод

Adds a route to the router that only match if the HTTP method is PUT
public addPut ( string $pattern, string | array $paths = null ) : ManaPHP\Mvc\Router\RouteInterface
$pattern string
$paths string | array
Результат ManaPHP\Mvc\Router\RouteInterface

match() публичный Метод

public match ( string $uri ) : array | false
$uri string
Результат array | false

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

$_routes защищенное свойство

protected RouteInterface[],ManaPHP\Mvc\Router $_routes
Результат ManaPHP\Mvc\Router\RouteInterface[]

$_useDefaultRoutes защищенное свойство

protected bool $_useDefaultRoutes
Результат boolean