Singleton pattern constructor / retreiver
This function allows the retrieval of the singleton instance of the class.
API Tags:
| Return: | The router instance |
| Access: | public |
Krai_Router __construct(
string
$kvfurl
)
|
|
Constructor - private to implement singleton pattern
This function parses the routes configuration file and stores the route objects.
Parameters:
API Tags:
void DoRoute(
string
$request
)
|
|
Execute a route
This function executes a route based on the parsing of the request parameter. It can only be called once, and after that will throw a Krai_Router_Exception.
Parameters:
|
string |
$request: |
The requested uri |
API Tags:
Information Tags:
| Throws: | Krai_Router_Exception |
void ExecuteRoute(
string
$_module, string
$_action, [
$_params = array()]
)
|
|
Actually execute a route
This function implements the actual execution of a route by instantiating the required module and calling the module's Krai_Module::DoAction() method.
Parameters:
|
string |
$_module: |
The name of the module to instantiate |
|
string |
$_action: |
The name of the action to execute |
|
array |
$_params: |
The parameters of the request |
API Tags:
Information Tags:
| Throws: | Krai_Router_Exception |
string UrlFor(
string
$_module, string
$_action, [
$_params = array()], [boolean
$_forlink = true]
)
|
|
Generate the URL for a certain module and action
This function generates a uri representing a certain combination of module, action, and parameters which, when parsed, would execute the same.
Parameters:
|
string |
$_module: |
The name of the module |
|
string |
$_action: |
The name of the action |
|
array |
$_params: |
An array of parameters |
|
boolean |
$_forlink: |
Whether or not to encode the uri returned for use in a link |
API Tags:
| Return: | The uri (including BASEURI). |
| Access: | public |