Class Controller_Routing_StaticSegment

Description

A routing segment that matches a URL based on straight string comparison.

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

Controller_Routing_Segment
   |
   --Controller_Routing_StaticSegment
Variable Summary
 mixed $pattern
Method Summary
 Controller_Routing_StaticSegment __construct (string $pattern, [Controller_Routing_Segment $next = null])
 boolean match (string $url, array &$params, string &$unmatched)
 mixed url_for (array &$params)
 string value ()
Variables
mixed $pattern (line 12)
  • access: protected

Inherited Variables

Inherited from Controller_Routing_Segment

Controller_Routing_Segment::$next
Methods
Constructor __construct (line 20)

Constructor

  • access: public
Controller_Routing_StaticSegment __construct (string $pattern, [Controller_Routing_Segment $next = null])

Redefinition of:
Controller_Routing_Segment::__construct()
Constructor
compare (line 67)

Compares this segment to another segment.

Returns a value of -1, 0, 1 to indicate $segment is less than, equal to, or greater than this segment, respectively. This method is used to construct routing trees. Segments which are equal will all be grouped together in a branch.

  • access: public
int compare (Controller_Routing_Segment $segment)

Redefinition of:
Controller_Routing_Segment::compare()
Compares this segment to another segment.
match (line 44)

Test a portion of a URL against this segment. Returns true if this segment matches, false otherwise.

  • access: public
boolean match (string $url, array &$params, string &$unmatched)
  • string $url: The URL portion to match
  • array &$params: Output parameter for any parameters discovered by this segment
  • string &$unmatched: Output parameter for the portion of the URL that was not matched (to be passed to the next segment

Redefinition of:
Controller_Routing_Segment::match()
Test a portion of a URL against this segment. Returns true if this segment matches, false otherwise.
url_for (line 83)

Essentially the reverse of match(), this method assembles a URL segment from a set of parameters. If this segment cannot construct a URL chunk for the parameters, it returns false. Note that upon completion, $params contains only unconsumed parameters.

  • access: public
mixed url_for (array &$params)
  • array &$params: The parameters to use for assembling the URL

Redefinition of:
Controller_Routing_Segment::url_for()
Essentially the reverse of match(), this method assembles a URL segment from a set of parameters. If this segment cannot construct a URL chunk for the parameters, it returns false. Note that upon completion, $params contains only unconsumed parameters.
value (line 31)

Return the value of this segment in human readable form.

  • access: public
string value ()

Redefinition of:
Controller_Routing_Segment::value()
Return the value of this segment in human readable form.

Inherited Methods

Inherited From Controller_Routing_Segment

 Controller_Routing_Segment::__construct()
 Controller_Routing_Segment::compare()
 Controller_Routing_Segment::match()
 Controller_Routing_Segment::next()
 Controller_Routing_Segment::next_url_token()
 Controller_Routing_Segment::set_next()
 Controller_Routing_Segment::url_for()
 Controller_Routing_Segment::value()

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