Aerys\Router::prefix PHP Method

prefix() public method

Prefix all the (already defined) routes with a given prefix
public prefix ( string $prefix ) : self
$prefix string
return self
    public function prefix(string $prefix)
    {
        $prefix = trim($prefix, "/");
        if ($prefix != "") {
            foreach ($this->routes as &$route) {
                $route[1] = "/{$prefix}{$route['1']}";
            }
            $this->actions = [];
        }
        return $this;
    }