$rules
$rules
All rewrite rules are defined in a JSON file at static/urls.json
uri(array $request, string $view, boolean $unique, boolean $leavename) : string
Returns the permalink for a matching request. Every request defined in static/urls.json must be unque, so that there are not matching and duplicate urls for the same request.
Here is an example usage:
$year = mysql2date("Y", $post->post_date);
$month = mysql2date("n", $post->post_date);
$uri = Cairn_Rewrite::uri(array(
'post_type' => 'post',
'year' => $year,
'monthnum' => $month,
'name' => $post_name
),
'default',
true,
false
);
| array | $request | The request as associative array that will match a rule. |
| string | $view | Name of the view for matching requests. |
| boolean | $unique | Weither to return one or several matches. |
| boolean | $leavename | Weither or not to leave the slug name. |
The permalink for the request.