메소드 | 설명 | |
---|---|---|
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 |
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 |