*/
class Route {
/**
- * controller for route if controller is no part of the route schema
+ * route controller if controller is no part of the route schema
* @var string
*/
protected $controller = null;
}
/**
- * Sets route schema, e.g. /{controller}/{id}
+ * Sets route schema, e.g. /{controller}/{id}.
*
* @param string $routeSchema
* @param string $controller
$part = str_replace(array('{', '}'), '', $part);
if ($part == 'controller') {
if ($this->controller !== null) {
- throw new SystemExyception('Controller may not be part of the scheme if a route controller is given.');
- }
- else {
- $hasController = true;
+ throw new SystemException('Controller may not be part of the scheme if a route controller is given.');
}
+
+ $hasController = true;
}
}
$this->routeData = $data;
- // adds route's controller if necessary
+ // adds route controller if given
if ($this->controller !== null) {
$this->routeData['controller'] = $this->controller;
}