public static function setEngine($ext, $ref) { if (is_string($ref)) { $ref = b::getReflectionClass($ref); } self::$engines[$ext] = $ref; }
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); }
public function engine($ext, $engine) { $this->_engines[$ext] = b::getReflectionClass($engine); return $this; }