.

ExactMatchRoute Class Reference
[Controller]

Allows only exact matches in URLs. More...

Inheritance diagram for ExactMatchRoute:
RouteBase IRoute IDispatcher IUrlBuilder StaticPageRoute

List of all members.

Public Member Functions

  weight_against_path ($path)
  Weights first path against the second.

Protected Member Functions

  build_url_path ($params)
  Build the URL (except base part).

Detailed Description

Allows only exact matches in URLs.

Author:
Gerd Riesselmann

Definition at line 10 of file exactmatchroute.cls.php.


Member Function Documentation

ExactMatchRoute::build_url_path ( params  )  [protected]

Build the URL (except base part).

Parameters:
mixed  $params Further parameters to use to build URL
Returns:
string

Reimplemented from RouteBase.

Definition at line 37 of file exactmatchroute.cls.php.

00037                                                    {
00038                 return ltrim($this->path, '/');
00039         }        
ExactMatchRoute::weight_against_path ( path  ) 

Weights first path against the second.

Only allows exact matches The return value is smaller the better the match is. 0 indicates a perfect match

Reimplemented from RouteBase.

Definition at line 17 of file exactmatchroute.cls.php.

00017                                                    {
00018                 $path = trim($path, '/');
00019                 $path_to_weight = trim($this->path, '/');
00020 
00021                 //print 'WEIGHT: ' . $path_to_weight . ' against ' . $path . ':';
00022                 if ($path != $path_to_weight) {
00023                         //print 'NO MATCH<br />';
00024                         return self::WEIGHT_NO_MATCH;
00025                 }
00026                 else {
00027                         return self::WEIGHT_FULL_MATCH;
00028                 }  
00029         }               

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