Esempio n. 1
0
File: Path.php Progetto: jankal/mvc
 /**
  * @param array $params
  * @return void
  */
 public function trigger(array $params)
 {
     $params['get'] = \Kernel::$request->query;
     unset($params['get']['p']);
     $params['post'] = \Kernel::$request->request;
     $params = array_merge($params, \Request::$additionalArgs);
     \Route::runMiddlewares($params);
     if ($this->runMiddlewares($params)) {
         if ($this->closure) {
             if (count($params) == 0) {
                 \DI::runClosure($this->action);
             } else {
                 \DI::runClosure($this->action, [$params]);
             }
         } else {
             $class = "Controller\\" . $this->action[0];
             $instance = \DI::getInstanceOf($class);
             if (count($params) == 0) {
                 $instance->{$this->action[1]}();
             } else {
                 $instance->{$this->action[1]}($params);
             }
         }
     }
 }
Esempio n. 2
0
File: Event.php Progetto: jankal/mvc
 /**
  * @param $args
  * @return void
  */
 public function trigger(...$args)
 {
     $c = $this->callable;
     \DI::runClosure($c, $args);
 }