Ejemplo n.º 1
0
Archivo: boot.php Proyecto: brego/prank
 /**
  * Runs the Controller determined by Boot::parse_url
  *
  * @return void
  */
 private function run_controller()
 {
     try {
         $registry = Registry::instance();
         $controller_name = to_controller($this->controller);
         $controller_object = new $controller_name($this->action, $this->action, $this->params, $this->controller, $this->config);
         $registry->current_controller = $controller_object;
         $controller_object->run($this->action, $this->action, $this->params, $this->controller, $this->config);
     } catch (Exception $e) {
         echo '<p>Exception: ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . ".</p>\n", str_replace("\n", "\n<br />", $e->getTraceAsString());
     }
 }
Ejemplo n.º 2
0
Archivo: base.php Proyecto: brego/prank
/**
 * Checks if method exists in the controller class.
 *
 * @return boolean
 * @param  string  $action     Shortname of the action.
 * @param  string  $controller Shortname of the controller.
 **/
function is_action_of($action, $controller)
{
    return method_exists(to_controller($controller), $action);
}