Public Member Functions | Static Public Member Functions | Public Attributes

RewriteRule Class Reference

Inheritance diagram for RewriteRule:
Collaboration diagram for RewriteRule:

List of all members.

Public Member Functions

 __construct ($paramarray=array())
 match ($stub)
 build ($args, $useall=true, $noamp=false)
 arg_match ($args)
 __get ($name)
 insert ()
 update ()
 delete ()

Static Public Member Functions

static default_fields ()
static create_url_rule ($build_str, $handler, $action)

Public Attributes

const RULE_SYSTEM = 0
const RULE_THEME = 1
const RULE_PLUGIN = 2
const RULE_CUSTOM = 5
 $entire_match = null
 $named_arg_values = array()

Detailed Description

Habari RewriteRule Class

Helper class to encapsulate rewrite rule data

Definition at line 15 of file rewriterule.php.


Constructor & Destructor Documentation

RewriteRule::__construct ( paramarray = array()  ) 

Constructor for the rewrite_rule class.

Parameters:
array $paramarray an associative array or querystring of initial field values

Reimplemented from QueryRecord.

Definition at line 53 of file rewriterule.php.


Member Function Documentation

RewriteRule::__get ( name  ) 

Magic property getter for this class

Parameters:
string $name The name of the class property to return
Returns:
mixed The value of that field in this object

Reimplemented from QueryRecord.

Definition at line 193 of file rewriterule.php.

RewriteRule::arg_match ( args  ) 

Returns a distance from 0 indicating the appropriateness of the rule based on the passed-in arguments.

Parameters:
array $args An array of arguments
Returns:
integer Returns 0 for an exact match, a higher number for less of a match
Todo:
Enable this logic

Definition at line 171 of file rewriterule.php.

RewriteRule::build ( args,
useall = true,
noamp = false 
)

Builds a URL using this rule based on the passed in data

Parameters:
array $args An associative array of arguments to use for replacement in the rule
boolean $useall If true (default), then all passed parameters that are not part of the built URL are tacked onto the URL as querystring
bool $noamp If true, use HTML-encoded ampersands in the output URL
Returns:
string The URL created from the substituted arguments

Definition at line 126 of file rewriterule.php.

static RewriteRule::create_url_rule ( build_str,
handler,
action 
) [static]

Create an old-style rewrite rule

Parameters:
string $build_str
string $handler
string $action
Returns:
RewriteRule The created rule

Definition at line 240 of file rewriterule.php.

Referenced by Pluggable::add_rule().

static RewriteRule::default_fields (  )  [static]

Returns the defined database columns for a rewrite rule.

Returns:
array Array of columns in the rewrite_rules table

Definition at line 32 of file rewriterule.php.

RewriteRule::delete (  ) 

Deletes an existing rule

Reimplemented from QueryRecord.

Definition at line 228 of file rewriterule.php.

RewriteRule::insert (  ) 

Saves a new rewrite rule to the rewrite_rules table

Reimplemented from QueryRecord.

Definition at line 212 of file rewriterule.php.

RewriteRule::match ( stub  ) 

Match the stub against this rule Also sets internal structures based on a successful match

Parameters:
string $stub The URL stub to match against
Returns:
boolean True if this rule matches the stub, false if not

Definition at line 71 of file rewriterule.php.

RewriteRule::update (  ) 

Updates an existing rule in the rewrite_rules table

Reimplemented from QueryRecord.

Definition at line 220 of file rewriterule.php.


The documentation for this class was generated from the following file: