Exemplo n.º 1
0
 /**
  * Do an execution based on a route
  *
  * @param $route The route to be executed
  * @return void
  */
 public static function run($route)
 {
     global $CONTROLLER;
     $controller_name = Ra_StringHelper::camelize($route['controller']) . 'Controller';
     $method = strtolower($route['action']);
     if (!class_exists($controller_name)) {
         dispatch_error(new Exception("Controller {$controller_name} doesn't exists"), 404);
     }
     $controller = new $controller_name($route);
     $controller->_current_route = $route;
     $controller->_params = array_merge($controller->_params, $route['params']);
     $CONTROLLER = $controller;
     $controller->execute($method);
 }
Exemplo n.º 2
0
 public function itShouldCamelizeString()
 {
     $original = "this_is_normal_string";
     $this->spec(Ra_StringHelper::camelize($original))->should->be("This_Is_Normal_String");
 }