public function add(Route $route, array $params = [])
    {
        $callback = $route->getCallable();
        if (empty($callback)) {
            return;
        }

        $this->routes[] = $route->getRoute();
        $paramNames = $route->getParamNames();
        foreach ($paramNames as $name) {
            if (isset($params[$name])) {
                $this->setParam($name, $params[$name]);
            }
        }

        if (is_array($callback)) {
            $this->callable = array_merge($this->callable, $callback);
        } elseif (!in_array($callback, $this->callable)) {
            $this->callable[] = $callback;
        }
    }
public function add(Route $route, array $params = [])
    {
        $callback = $route->getCallable();
        if (empty($callback)) {
            return;
        }

        $this->routes[] = $route->getRoute();
        $paramNames = $route->getParamNames();
        foreach ($paramNames as $name) {
            if (isset($params[$name])) {
                $this->setParam($name, $params[$name]);
            }
        }

        if (is_array($callback)) {
            $this->callable = array_merge($this->callable, $callback);
        } elseif (!in_array($callback, $this->callable)) {
            $this->callable[] = $callback;
        }
    }
public function add ( Route $ route , array $ params = [ ] ) { $ callback = $ route -> getCallable ( ) ; if ( empty ( $ callback ) ) { return ; } $ this -> routes [ ] = $ route -> getRoute ( ) ; $ paramNames = $ route -> getParamNames ( ) ; foreach ( $ paramNames as $ name ) { if ( isset ( $ params [ $ name ] ) ) { $ this -> setParam ( $ name , $ params [ $ name ] ) ; } } if ( is_array ( $ callback ) ) { $ this -> callable = array_merge ( $ this -> callable , $ callback ) ; } elseif ( ! in_array ( $ callback , $ this -> callable ) ) { $ this -> callable [ ] = $ callback ; } }
add request handle

@param Route $route
@param array $params
@return void
add request handle