Library/Think/Http/Router.class.php
/**
     * Add named route
     * @param  string            $name  The route name
     * @param  \Think\Http\Route $route The route object
     * @throws \RuntimeException If a named route already exists with the same name
     */
Add named route
@param  string            $name  The route name
@param  \Think\Http\Route $route The route object
@throws \RuntimeException If a named route already exists with the same name
Add named route @param string $name The route name @param \ Think \ Http \ Route $route The route object @throws \ RuntimeException If a named route already exists with the same name
public function addNamedRoute($name, \Think\Http\Route $route) {
        if ($this->hasNamedRoute($name)) {
            throw new \RuntimeException('Named route already exists with name: ' . $name);
        }
        $this->namedRoutes[(string) $name] = $route;
    }
public function addNamedRoute ( $ name , \ Think \ Http \ Route $ route ) { if ( $ this -> hasNamedRoute ( $ name ) ) { throw new \ RuntimeException ( 'Named route already exists with name: ' . $ name ) ; } $ this -> namedRoutes [ ( string ) $ name ] = $ route ; }
Add named route
 @param  string            $name  The route name
 @param  \Think\Http\Route $route The route object
 @throws \RuntimeException If a named route already exists with the same name
Add named route @param string $name The route name @param \ Think \ Http \ Route $route The route object @throws \ RuntimeException If a named route already exists with the same name