PHP Класс Habari\RewriteRule

Helper class to encapsulate rewrite rule data
Наследование: extends QueryRecord
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$entire_match
$named_arg_values Entire matched string from the URL

Открытые методы

Метод Описание
__construct ( array $paramarray = [] ) Constructor for the rewrite_rule class.
__get ( string $name ) : mixed Magic property getter for this class
arg_match ( array $args ) : integer Returns a distance from 0 indicating the appropriateness of the rule based on the passed-in arguments.
build ( array $args, boolean $useall = true, boolean $noamp = false ) : string Builds a URL using this rule based on the passed in data
create_url_rule ( string $build_str, string $handler, string $action ) : RewriteRule Create an old-style rewrite rule
default_fields ( ) : array Returns the defined database columns for a rewrite rule.
delete ( ) Deletes an existing rule
insert ( ) Saves a new rewrite rule to the rewrite_rules table
match ( string $stub ) : boolean Match the stub against this rule Also sets internal structures based on a successful match
update ( ) Updates an existing rule in the rewrite_rules table

Описание методов

__construct() публичный Метод

Constructor for the rewrite_rule class.
public __construct ( array $paramarray = [] )
$paramarray array an associative array or querystring of initial field values

__get() публичный Метод

Magic property getter for this class
public __get ( string $name ) : mixed
$name string The name of the class property to return
Результат mixed The value of that field in this object

arg_match() публичный Метод

Returns a distance from 0 indicating the appropriateness of the rule based on the passed-in arguments.
public arg_match ( array $args ) : integer
$args array An array of arguments
Результат integer Returns 0 for an exact match, a higher number for less of a match

build() публичный Метод

Builds a URL using this rule based on the passed in data
public build ( array $args, boolean $useall = true, boolean $noamp = false ) : string
$args array An associative array of arguments to use for replacement in the rule
$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 If true, use HTML-encoded ampersands in the output URL
Результат string The URL created from the substituted arguments

create_url_rule() публичный статический Метод

Create an old-style rewrite rule
public static create_url_rule ( string $build_str, string $handler, string $action ) : RewriteRule
$build_str string
$handler string
$action string
Результат RewriteRule The created rule

default_fields() публичный статический Метод

Returns the defined database columns for a rewrite rule.
public static default_fields ( ) : array
Результат array Array of columns in the rewrite_rules table

delete() публичный Метод

Deletes an existing rule
public delete ( )

insert() публичный Метод

Saves a new rewrite rule to the rewrite_rules table
public insert ( )

match() публичный Метод

Match the stub against this rule Also sets internal structures based on a successful match
public match ( string $stub ) : boolean
$stub string The URL stub to match against
Результат boolean True if this rule matches the stub, false if not

update() публичный Метод

Updates an existing rule in the rewrite_rules table
public update ( )

Описание свойств

$entire_match публичное свойство

public $entire_match

$named_arg_values публичное свойство

Entire matched string from the URL
public $named_arg_values