PHP 클래스 Phlyty\Route

Encapsulates the route, the callback to execute, and the methods it will respond to.
파일 보기 프로젝트 열기: phly/phlyty 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allowedMethods array Allowed methods
$controller callable Callable assigned to this route
$methods array Methods this route responds to
$name null | string Name of this route (if any)
$route Zend\Mvc\Router\RouteInterface Route object

공개 메소드들

메소드 설명
__construct ( Zend\Mvc\Router\RouteInterface $route, callable $controller ) Constructor
allowMethod ( string $method ) : void Add an HTTP method you will allow
controller ( ) : callable Retrieve controller assigned to this route
name ( null | string $name = null ) : Route | string Retrieve and/or set the route name
respondsTo ( null | string $method = null ) : array | boolean Does this route respond to the given method?
route ( ) : Zend\Mvc\Router\RouteInterface Get the actual route interface
via ( string | array $method ) : Route Assign one or more methods this route will respond to

메소드 상세

__construct() 공개 메소드

Accepts the router and controller.
public __construct ( Zend\Mvc\Router\RouteInterface $route, callable $controller )
$route Zend\Mvc\Router\RouteInterface
$controller callable

allowMethod() 공개 정적인 메소드

Add an HTTP method you will allow
public static allowMethod ( string $method ) : void
$method string
리턴 void

controller() 공개 메소드

Retrieve controller assigned to this route
public controller ( ) : callable
리턴 callable

name() 공개 메소드

Sets the route name if a non-empty string is provided, and then returns the Route instance to allow a fluent interface. Otherwise, returns the route name.
public name ( null | string $name = null ) : Route | string
$name null | string
리턴 Route | string

respondsTo() 공개 메소드

If no method is provided, returns array of all methods to which this route will respond.
public respondsTo ( null | string $method = null ) : array | boolean
$method null | string
리턴 array | boolean

route() 공개 메소드

Get the actual route interface
public route ( ) : Zend\Mvc\Router\RouteInterface
리턴 Zend\Mvc\Router\RouteInterface

via() 공개 메소드

Additional arguments will be used as additional methods.
public via ( string | array $method ) : Route
$method string | array
리턴 Route

프로퍼티 상세

$allowedMethods 보호되어 있는 정적으로 프로퍼티

Allowed methods
protected static array $allowedMethods
리턴 array

$controller 보호되어 있는 프로퍼티

Callable assigned to this route
protected callable $controller
리턴 callable

$methods 보호되어 있는 프로퍼티

Methods this route responds to
protected array $methods
리턴 array

$name 보호되어 있는 프로퍼티

Name of this route (if any)
protected null|string $name
리턴 null | string

$route 보호되어 있는 프로퍼티

Route object
protected RouteInterface,Zend\Mvc\Router $route
리턴 Zend\Mvc\Router\RouteInterface