Method | Description | |
---|---|---|
__construct ( string $path, string | array $callback, array $options = [], string $host = '', array $schemes = [], array $methods = [] ) | Base constructor. | |
addOption ( string $name, array $attributes ) | Adds a single route option. | |
compile ( ) : |
Compiles the route object and returns an instance of CompiledRoute. | |
getCallback ( ) : string | array | Get the attached callback name. | |
getHost ( ) : string | Get current host name. | |
getMethods ( ) : array | Get the current defined methods. | |
getOptions ( ) : array | Returns route options. | |
getPath ( ) : string | Get the route path. | |
getRealPath ( ) : string | Get the real path. | |
getSchemes ( ) : array | Get the current defined schemes. | |
getTags ( ) : array | Get the route tags. | |
hasOption ( string $name ) : boolean | Checks if route has options attached to the given parameter. | |
setCallback ( string | array $callback ) | Set the route callback. | |
setHost ( string $host ) | Sets the host name to the route. | |
setMethods ( array | string $methods ) | Match only requests that are within this set of methods. | |
setOptions ( array $options ) | Set route options. | |
setPath ( string $path ) | Sets the route path. | |
setSchemes ( array | string $schemes ) | Match only requests that are within this set of schemes. | |
setTags ( array $tags ) | Sets the route tags. |
public __construct ( string $path, string | array $callback, array $options = [], string $host = '', array $schemes = [], array $methods = [] ) | ||
$path | string | Path with parameter names that identifies the route. |
$callback | string | array | Attached callback for this route. |
$options | array | List of options, mostly for parameters. Common option keys are 'pattern' and 'default'. Pattern defines the regular expression for the defined parameter. Default sets the default value for the parameter if it's not matched withing the route. |
$host | string | Fully qualified host name that will be added as a filer for matching the url. |
$schemes | array | An array of supported schemas that the url must match. |
$methods | array | An array of supported methods that the url must match. |
public compile ( ) : |
||
return |
public getCallback ( ) : string | array | ||
return | string | array |
public getMethods ( ) : array | ||
return | array |
public getSchemes ( ) : array | ||
return | array |
public setCallback ( string | array $callback ) | ||
$callback | string | array | Callback that will be attached to this route. Note that this callback can be overwritten during the routing process. |
public setMethods ( array | string $methods ) | ||
$methods | array | string | Method(s) to match. |
public setOptions ( array $options ) | ||
$options | array | An array of options. Each option must have a name and a list of attributes and their values. Common attributes are 'prefix' and 'default'. |
public setSchemes ( array | string $schemes ) | ||
$schemes | array | string | Scheme(s) to match. |