Welcome, Guest Log In

Class Krai_Router_Route

Class Overview

A route instance

This class represents an instance of a route parsed from the routes configuration file. It provides functionality to determine whether or not it matches a given request, whether or not it should be applied in the generating of a url in Krai_Router::UrlFor(), and can generate that url given the data necessary.

Located in /Krai/Router/Route.php [line 26]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
array   $_forcemap   Holds the variable overrides for this route
array   $_parts   Holds the parts of the pattern for this route
array   $_reconstruct_requires   Holds the variables that are required for reconstruct

[ Top ]
Method Summary
Krai_Router_Route   __construct()   Constructor
mixed   Matches()   Determine whether or not a split request fits the pattern
boolean   MatchUrlFor()   Determines matching when trying to generate a uri from route data.
string   Reconstruct()   Reconstruct the uri for this route

[ Top ]
Properties
array   $_forcemap = array() [line 46]

Holds the variable overrides for this route

This array holds the parts of the pattern that were statically set in the routes configuration file (after the "-->").

API Tags:
Access:  private


[ Top ]
array   $_parts = array() [line 36]

Holds the parts of the pattern for this route

This array holds the parts of the pattern defining this route.

API Tags:
Access:  private


[ Top ]
array   $_reconstruct_requires = array() [line 57]

Holds the variables that are required for reconstruct

This array holds the names of parameters necessary to fill in the pattern for the route.

API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 68]

  Krai_Router_Route __construct( $parts, $forcemap  )

Constructor

This function creates the route instance and records the appropriate patterns in the appropriate variables. It is called in Krai_Router::__construct().

Parameters:
array   $parts:  The parts of the route
array   $forcemap:  The parts of the route after the "-->"

API Tags:
Access:  public


[ Top ]
Matches  [line 107]

  mixed Matches( $str_parts  )

Determine whether or not a split request fits the pattern

This function decides whether or not the requested url matches this pattern represented by the instance. The parameter is essentially the http://www.php.net/explode of the REQUEST_URI. This function is called by Krai_Router::DoRoute().

Parameters:
array   $str_parts:  The parts of the uri explosion

API Tags:
Return:  Array of parameter values if matched or false if not matched
Access:  public


[ Top ]
MatchUrlFor  [line 166]

  boolean MatchUrlFor( string $_module, string $_action, $_params  )

Determines matching when trying to generate a uri from route data.

This function determines whether or not the pattern represented by this instance could be used to construct a url which would lead back to that data upon reparsing. It is called in Krai_Router::UrlFor().

Parameters:
string   $_module:  The name of the module
string   $_action:  The name of the action
array   $_params:  Additional parameters that need to be considered

API Tags:
Return:  Success of matching attempt
Access:  public


[ Top ]
Reconstruct  [line 235]

  string Reconstruct( string $_module, string $_action, [ $_params = array()], [ $_forlink = true]  )

Reconstruct the uri for this route

This function actually generates a uri by filling in the blanks in the pattern represented by the instance with the appropriate data presented by the parameters.

Parameters:
string   $_module:  The module of the route
string   $_action:  The action of the route
array   $_params:  The query parameters
   $_forlink: 

API Tags:
Return:  The uri
Access:  public


[ Top ]

Documentation generated on Fri, 25 Jul 2008 15:19:50 -0400 by phpDocumentor 1.4.2
Krai Framework site admin credits sitemap valid xhtml?