UrlRewrite
in package
Simple support class for optional url redirect
Tags
Table of Contents
Properties
- $db : SQL
- $nav : Navigation
Methods
- __construct() : mixed
- findUrl() : string|null
- Find given url in record and return target url
- redirect() : void
- Redirect to given url
- rewrite() : string
- Format url
Properties
$db
protected
SQL
$db
$nav
protected
Navigation
$nav
Methods
__construct()
public
__construct(SQL $db, Navigation $nav[, string|null $url = null ]) : mixed
Parameters
- $db : SQL
- $nav : Navigation
- $url : string|null = null
findUrl()
Find given url in record and return target url
public
findUrl(string $url) : string|null
Parameters
- $url : string
Return values
string|nullredirect()
Redirect to given url
public
redirect(string $url[, bool $permanent = true ]) : void
Parameters
- $url : string
- $permanent : bool = true
rewrite()
Format url
protected
rewrite(array<string, mixed> $item[, string $url = '' ]) : string
Parameters
- $item : array<string, mixed>
- $url : string = ''