예제 #1
0
파일: render.php 프로젝트: boltphp/core
 public static function setEngine($ext, $ref)
 {
     if (is_string($ref)) {
         $ref = b::getReflectionClass($ref);
     }
     self::$engines[$ext] = $ref;
 }
예제 #2
0
파일: route.php 프로젝트: boltphp/core
 public function build($params = [])
 {
     // what method
     $method = $this->request->getMethod();
     // is there an action
     $action = b::param('_action', false, $params);
     // lets figure out what function we're going to call
     $try = ['dispatch', "{$method}{$action}", $action, $method];
     foreach ($try as $func) {
         if (method_exists($this, $func)) {
             break;
         }
     }
     // reflect the controller and method
     // and figure out what params we need
     $ref = b::getReflectionClass(get_called_class());
     // get
     $args = $this->getArgsFromMethodRef($ref->getMethod($func), $params);
     // wonderfull, lets call the function and figure out what
     // they respond with
     return call_user_func_array([$this, $func], $args);
 }
예제 #3
0
파일: browser.php 프로젝트: boltphp/core
 public function engine($ext, $engine)
 {
     $this->_engines[$ext] = b::getReflectionClass($engine);
     return $this;
 }