Class Controller_Routing_Route

Description

Represents a complete route in the system. A route is comprised of one or more segments.

Located in /controller/lib/Controller/Routing/Route.php (line 10)


	
			
Variable Summary
 mixed $constraints
 mixed $defaults
 mixed $name
 mixed $postion
Method Summary
 Controller_Routing_Route __construct ([int $position = null], [Controller_Routing_Segment $segments = null], [array $constraints = array()], [array $defaults = array()], [string $name = null])
 array constraints ()
 array defaults ()
 boolean match (string $url, string $method, array &$params)
 string name ()
 boolean passes_method_constraints (string $method)
 boolean passes_parameter_constraints (array $params)
 int position ()
 void set_constraints (array $constraints)
 void set_defaults (array $defaults)
 void set_name (string $name)
 void set_position (int $position)
 mixed url_for (array $params, string $method)
Variables
mixed $constraints (line 14)
  • access: protected
mixed $defaults (line 15)
  • access: protected
mixed $name (line 16)
  • access: protected
mixed $postion (line 12)
  • access: protected
mixed $segmentsHead (line 13)
  • access: protected
Methods
Constructor __construct (line 27)

Constructor

  • access: public
Controller_Routing_Route __construct ([int $position = null], [Controller_Routing_Segment $segments = null], [array $constraints = array()], [array $defaults = array()], [string $name = null])
  • int $position: Route position
  • Controller_Routing_Segment $segments: The list of segments in the route
  • array $constraints: Any constraints on the route
  • array $defaults: Any default parameters for the route
  • string $name: The route name, if any
constraints (line 60)

Return this route's constraints

  • access: public
array constraints ()
defaults (line 78)

Return this route's default parameters

  • access: public
array defaults ()
first_segment (line 114)

Return this route's first segment

  • access: public
Controller_Routing_Segment first_segment ()
match (line 135)

Determine if this route matches the given URL

  • access: public
boolean match (string $url, string $method, array &$params)
  • string $url: The URL to match
  • string $method: The request method (e.g. "GET")
  • array &$params: Input/output parameter request parameters
name (line 96)

Return this route's name

  • access: public
string name ()
passes_method_constraints (line 225)

Tests if a request method matches any constraints set on this route

  • access: public
boolean passes_method_constraints (string $method)
  • string $method: The request method to test
passes_parameter_constraints (line 250)

Tests if a request method matches any parameter constraints set on this route

  • access: public
boolean passes_parameter_constraints (array $params)
  • array $params: The parameters to test
position (line 42)

Return this route's position

  • access: public
int position ()
set_constraints (line 69)

Set this route's constraints

  • access: public
void set_constraints (array $constraints)
  • array $constraints: The new constraints
set_defaults (line 87)

Set this route's default parameters

  • access: public
void set_defaults (array $defaults)
  • array $defaults: The new default values
set_first_segment (line 123)

Set this route's first segment

  • access: public
void set_first_segment (Controller_Routing_Segment $segment)
set_name (line 105)

Set this route's name

  • access: public
void set_name (string $name)
  • string $name: The new name
set_position (line 51)

Set this route's position

  • access: public
void set_position (int $position)
  • int $position: The new position value
url_for (line 169)

Essentially the opposite of match(), this attempts to build a URL from a set of parameters. It returns the constructed URL on success, or false on failure.

  • access: public
mixed url_for (array $params, string $method)
  • array $params: The parameters to assemble a URL for
  • string $method: The request method (e.g. "GET")

Documentation generated on Wed, 25 Apr 2012 09:46:45 -0700 by phpDocumentor 1.4.3