PHP Class flight\net\Route

Datei anzeigen Open project: mikecao/flight

Public Properties

Property Type Description
$callback Callback function
$methods HTTP methods
$params Route parameters
$pass Pass self in callback parameters
$pattern URL pattern
$regex Matching regular expression
$splat URL splat content

Public Methods

Method Description
__construct ( string $pattern, mixed $callback, array $methods, boolean $pass ) Constructor.
matchMethod ( string $method ) : boolean Checks if an HTTP method matches the route methods.
matchUrl ( string $url, boolean $case_sensitive = false ) : boolean Checks if a URL matches the route pattern. Also parses named parameters in the URL.

Method Details

__construct() public method

Constructor.
public __construct ( string $pattern, mixed $callback, array $methods, boolean $pass )
$pattern string URL pattern
$callback mixed Callback function
$methods array HTTP methods
$pass boolean Pass self in callback parameters

matchMethod() public method

Checks if an HTTP method matches the route methods.
public matchMethod ( string $method ) : boolean
$method string HTTP method
return boolean Match status

matchUrl() public method

Checks if a URL matches the route pattern. Also parses named parameters in the URL.
public matchUrl ( string $url, boolean $case_sensitive = false ) : boolean
$url string Requested URL
$case_sensitive boolean Case sensitive matching
return boolean Match status

Property Details

$callback public_oe property

Callback function
public $callback

$methods public_oe property

HTTP methods
public $methods

$params public_oe property

Route parameters
public $params

$pass public_oe property

Pass self in callback parameters
public $pass

$pattern public_oe property

URL pattern
public $pattern

$regex public_oe property

Matching regular expression
public $regex

$splat public_oe property

URL splat content
public $splat