Метод | Описание | |
---|---|---|
ajax ( string $context, array | string | object $args = [] ) : string | Helper method for ajax rule | |
auth_ajax ( string $context, array | string | object $args = [] ) : string | Helper method for auth_ajax rule | |
extract_args ( mixed $args, string $prefix = '' ) : array | Extract the possible arguments to use in the URL from the passed variable | |
get ( mixed $rule_names = '', mixed $args = [], boolean $useall = true, boolean $noamp = false, boolean $prepend_site = true ) : string | Builds the required pretty URL given a supplied rule name and a set of placeholder replacement values and returns the built URL. | |
get_active_rules ( ) : array | Get the active RewriteRules that are cached in self::load_rules(). | |
get_from_filesystem ( string $path, string | boolean $trail = false, boolean $preserve_file = false ) : string | Get a fully-qualified URL from a filesystem path | |
get_matched_rule ( ) : |
Get the matched RewriteRule that was matched in parse(). | |
out ( string $rule_name = null, array $args = [], boolean $useall = true, boolean $noamp = true, boolean $prepend_site = true ) : void | Helper wrapper function. Outputs the URL via echo. | |
parse ( string $from_url ) : |
Match a URL/URI against the rewrite rules stored in the DB. | |
set_404 ( ) : |
Cause the matched rule to be unset in the case of a 404 |
Метод | Описание | |
---|---|---|
instance ( ) | Enables singleton working properly |
Метод | Описание | |
---|---|---|
load_rules ( ) | A simple caching mechanism to avoid reloading rule array |
URL::get( 'display_entries_by_date', array(
'year' => '2000',
'month' => '05',
'day' => '01',
) );
public static get ( mixed $rule_names = '', mixed $args = [], boolean $useall = true, boolean $noamp = false, boolean $prepend_site = true ) : string | ||
$rule_names | mixed | string name of the rule or array of rules which would build the URL |
$args | mixed | (optional) array or object of placeholder replacement values |
$useall | boolean | If true (default), then all passed parameters that are not part of the built URL are tacked onto the URL as querystring |
$noamp | boolean | |
$prepend_site | boolean | If true (default), a full URL is returned, if false, only the path part of the URL is returned |
Результат | string |
public static get_active_rules ( ) : array | ||
Результат | array | RewriteRules active rules, or null |
public static get_from_filesystem ( string $path, string | boolean $trail = false, boolean $preserve_file = false ) : string | ||
$path | string | The filesystem path |
$trail | string | boolean | If true, include a trailing slash. If string, append this to the requested url. Default: Add nothing. |
$preserve_file | boolean | If true, leave the filename on the URL. Default: Remove filename. |
Результат | string | URL |
public static get_matched_rule ( ) : |
||
Результат | matched rule, or null |
protected static instance ( ) |
public static out ( string $rule_name = null, array $args = [], boolean $useall = true, boolean $noamp = true, boolean $prepend_site = true ) : void | ||
$rule_name | string | name of the rule which would build the URL |
$args | array | (optional) array of placeholder replacement values |
$useall | boolean | If true (default), then all passed parameters that are not part of the built URL are tacked onto the URL as querystring |
$noamp | boolean | |
$prepend_site | boolean | If true (default), a full URL is returned, if false, only the path part of the URL is returned |
Результат | void |
public static set_404 ( ) : |
||
Результат | A rewrite rule that represents a 404 error - no match on the URL requested |