public function addPrefix($prefix, array $defaults = [], array $requirements = [])
    {
        $prefix = trim(trim($prefix), '/');

        if ('' === $prefix) {
            return;
        }

        foreach ($this->routes as $route) {
            $route->setPath('/'.$prefix.$route->getPath());
            $route->addDefaults($defaults);
            $route->addRequirements($requirements);
        }
    }
public function addPrefix($prefix, array $defaults = [], array $requirements = [])
    {
        $prefix = trim(trim($prefix), '/');

        if ('' === $prefix) {
            return;
        }

        foreach ($this->routes as $route) {
            $route->setPath('/'.$prefix.$route->getPath());
            $route->addDefaults($defaults);
            $route->addRequirements($requirements);
        }
    }
public function addPrefix ( $ prefix , array $ defaults = [ ] , array $ requirements = [ ] ) { $ prefix = trim ( trim ( $ prefix ) , '/' ) ; if ( '' === $ prefix ) { return ; } foreach ( $ this -> routes as $ route ) { $ route -> setPath ( '/' . $ prefix . $ route -> getPath ( ) ) ; $ route -> addDefaults ( $ defaults ) ; $ route -> addRequirements ( $ requirements ) ; } }
Adds a prefix to the path of all child routes.

@param string $prefix       An optional prefix to add before each pattern of the route collection
@param array  $defaults     An array of default values
@param array  $requirements An array of requirements
Adds a prefix to the path of all child routes .