RouterHelper
class RouterHelper
Methods that may be useful for processing routing activity
Methods
Adds leading slash and removes trailing slash from the URL.
Splits an URL by segments separated by the slash symbol.
Rebuilds a URL from an array of segments.
Replaces :column_name with it's object value. Example: /some/link/:id/:name -> /some/link/1/Joe
Checks whether an URL pattern segment is a wildcard.
Checks whether an URL pattern segment is optional.
Extracts the parameter name from a URL pattern segment definition.
Extracts the regular expression from a URL pattern segment definition.
Extracts the default parameter value from a URL pattern segment definition.
Details
at line 20
static string
normalizeUrl(string $url)
Adds leading slash and removes trailing slash from the URL.
at line 42
static array
segmentizeUrl(string $url)
Splits an URL by segments separated by the slash symbol.
at line 62
static string
rebuildUrl(array $urlArray)
Rebuilds a URL from an array of segments.
at line 81
static string
parseValues(stdClass|array $object, array $columns, string $string)
Replaces :column_name with it's object value. Example: /some/link/:id/:name -> /some/link/1/Joe
at line 107
static bool
segmentIsWildcard(string $segment)
Checks whether an URL pattern segment is a wildcard.
at line 117
static bool
segmentIsOptional(string $segment)
Checks whether an URL pattern segment is optional.
at line 143
static string
getParameterName(string $segment)
Extracts the parameter name from a URL pattern segment definition.
at line 179
static string
getSegmentRegExp(string $segment)
Extracts the regular expression from a URL pattern segment definition.
at line 198
static string
getSegmentDefaultValue(string $segment)
Extracts the default parameter value from a URL pattern segment definition.