Phalcon\Http\Uri::extendPath PHP Method

extendPath() public method

public extendPath ( $path )
    public function extendPath($path)
    {
        if (empty($path)) {
            return $this;
        }
        if (!strncmp($path, '/', 1)) {
            $this->parts['path'] = $path;
            return $this;
        }
        if (empty($this->parts['path'])) {
            $this->parts['path'] = '/' . $path;
            return $this;
        }
        $this->parts['path'] = substr($this->parts['path'], 0, strrpos($this->parts['path'], '/') + 1) . $path;
        return $this;
    }