예제 #1
0
파일: boot.php 프로젝트: 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());
     }
 }
예제 #2
0
파일: base.php 프로젝트: 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);
}