Aerys\Router::prefix PHP 메소드

prefix() 공개 메소드

Prefix all the (already defined) routes with a given prefix
public prefix ( string $prefix ) : self
$prefix string
리턴 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;
    }