Rule
class Rule
Router Rule Object
Adapted from october\rain\router\Rule
Properties
protected string | $ruleName | ||
protected string | $rulePattern | ||
protected Closure | $conditionCallback | ||
protected Closure | $afterMatchCallback | ||
string | $staticUrl | ||
array | $segments | ||
int | $staticSegmentCount | ||
int | $dynamicSegmentCount | ||
int | $wildSegmentCount |
Methods
__construct(string $name, string $pattern)
Creates a new router rule instance.
bool
resolveUrl(string $url, array $parameters)
Checks whether a given URL matches a given pattern.
array
captureWildcardSegments(array $urlSegments)
Captures and removes every segment of a URL after a wildcard pattern segment is detected, until both collections of segments are the same size.
object
name(string $name = null)
Unique route name
object
pattern(string $pattern = null)
Route match pattern
callable
condition(callable $callback = null)
Condition callback
callable
afterMatch(callable $callback = null)
After match callback
Details
at line 66
__construct(string $name, string $pattern)
Creates a new router rule instance.
at line 99
bool
resolveUrl(string $url, array $parameters)
Checks whether a given URL matches a given pattern.
at line 219
protected array
captureWildcardSegments(array $urlSegments)
Captures and removes every segment of a URL after a wildcard pattern segment is detected, until both collections of segments are the same size.
at line 257
object
name(string $name = null)
Unique route name
at line 274
object
pattern(string $pattern = null)
Route match pattern
at line 292
callable
condition(callable $callback = null)
Condition callback
at line 317
callable
afterMatch(callable $callback = null)
After match callback