public function set($route, array $arguments = array())
    {
        if (!is_array($route)) {

            $pattern = $route;
            $list = $this->getList();

            if (empty($list[$pattern])) {
                throw new OutOfBoundsException("Unknown route pattern $pattern");
            }

            $route = $list[$pattern];
            $route += array('arguments' => array(), 'pattern' => $pattern);
            $route['simple_pattern'] = preg_replace('@\(.*?\)@', '*', $pattern);

            if (!empty($arguments)) {
                $route['arguments'] = array_merge($arguments, $route['arguments']);
            }
        }

        return $this->route = $route;
    }
public function set($route, array $arguments = array())
    {
        if (!is_array($route)) {

            $pattern = $route;
            $list = $this->getList();

            if (empty($list[$pattern])) {
                throw new OutOfBoundsException("Unknown route pattern $pattern");
            }

            $route = $list[$pattern];
            $route += array('arguments' => array(), 'pattern' => $pattern);
            $route['simple_pattern'] = preg_replace('@\(.*?\)@', '*', $pattern);

            if (!empty($arguments)) {
                $route['arguments'] = array_merge($arguments, $route['arguments']);
            }
        }

        return $this->route = $route;
    }
public function set ( $ route , array $ arguments = array ( ) ) { if ( ! is_array ( $ route ) ) { $ pattern = $ route ; $ list = $ this -> getList ( ) ; if ( empty ( $ list [ $ pattern ] ) ) { throw new OutOfBoundsException ( "Unknown route pattern $pattern" ) ; } $ route = $ list [ $ pattern ] ; $ route += array ( 'arguments' => array ( ) , 'pattern' => $ pattern ) ; $ route [ 'simple_pattern' ] = preg_replace ( '@\(.*?\)@' , '*' , $ pattern ) ; if ( ! empty ( $ arguments ) ) { $ route [ 'arguments' ] = array_merge ( $ arguments , $ route [ 'arguments' ] ) ; } } return $ this -> route = $ route ; }
Sets a route
@param array|string $route
@param array $arguments
@return array
@throws OutOfBoundsException
Sets a route