(static) parseRequestString (request) → {Object}
Parses the request string to route-like object. Request format: "controller:action?data" . Controller part is required.
Part of request |
Description |
controller |
shall not contain characters : and ? |
action separator |
default is : |
action |
shall not contain character ? |
data separator |
default is ? |
data |
set of properties and its values in the form property1=value1&property2=value2 |
Parameters:
Name |
Type |
Description |
request |
string
|
|
Throws:
-
Exception if request has an invalid format.
Returns:
-
Object
:
- {controller: string, action: string, data: Object|null}
Example:
Valid request strings:
"controller"
"controller:action"
"controller:action?par1=value1"
"controller?par1=value1"
"controller:action?par1=value1&par2=value2"
"controller:action?par1&par2=value2"
|
(static) validate (route)
Checks if route has a valid format (ie. looks like Route).
Parameters:
Name |
Type |
Description |
route |
Object
|
string
|
Route object. Property 'controller' or 'forward' is required. String is shortcut to {forward: route}. |
Throws:
-
Exception if route has an invalid format.
|
refine (config)
Refines properties of the route.
Parameters:
Name |
Type |
Description |
config |
Object
|
string
|
Object may refine properties 'controller', 'forward', 'action', 'data'. String refines 'forward' property. |
|
toHumanString () → {string}
Gets a human readable string representation of this route. Note: This is not an inverse operation to the parseRequestString() method.
Returns:
|
toString () → {string}
Returns a string representation of the object.
Returns:
|