PHP 클래스 ManaPHP\Mvc\Router\Group

상속: extends ManaPHP\Component, implements ManaPHP\Mvc\Router\GroupInterface
파일 보기 프로젝트 열기: manaphp/manaphp 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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