summaryrefslogtreecommitdiffstats
path: root/system/classes
diff options
context:
space:
mode:
Diffstat (limited to 'system/classes')
-rw-r--r--system/classes/route.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/system/classes/route.php b/system/classes/route.php
index e791155..c1b9457 100644
--- a/system/classes/route.php
+++ b/system/classes/route.php
@@ -50,11 +50,30 @@ class Route {
*/
private static $routes = array();
+ /**
+ * Constructs a route.
+ *
+ * @param string $name Name of the route
+ * @param mixed $rule Rule for this route
+ * @param array $defaults Default parameters for the route
+ * @return Route Initialized Route
+ * @access protected
+ */
protected function __construct($name, $rule, $defaults) {
$this->name = $name;
$this->rule = $rule;
$this->defaults = $defaults;
}
+
+ /**
+ * Generates a url for a route
+ *
+ * @param array $params Parameters to substitute in the route
+ * @param bool $absolute Whether to return an absolute url
+ * @param string $protocol Protocol to use for absolute url
+ * @return string Generated url
+ * @access public
+ */
public function url($params = array(), $absolute = false, $protocol = 'http') {
if (is_callable($this->rule))
throw new Exception("The rule for '{$this->name}' route is a function and cannot be reversed");