public function setPath($path, $type = 'replace', $replace = '')
    {
        $oldPath = (!empty($this->url['path']) ? $this->url['path'] : '');

        switch ($type) {
            case 'add':
                $path = $oldPath . $path;
                break;
            case 'remove':
                $path = str_replace($path, '', $oldPath);
                break;
            case 'replace':
            default:
                $path = str_replace($replace, $path, $oldPath);
                break;
        }

        $this->url['path'] = $path;

        return $this;
    }
public function setPath($path, $type = 'replace', $replace = '')
    {
        $oldPath = (!empty($this->url['path']) ? $this->url['path'] : '');

        switch ($type) {
            case 'add':
                $path = $oldPath . $path;
                break;
            case 'remove':
                $path = str_replace($path, '', $oldPath);
                break;
            case 'replace':
            default:
                $path = str_replace($replace, $path, $oldPath);
                break;
        }

        $this->url['path'] = $path;

        return $this;
    }
public function setPath ( $ path , $ type = 'replace' , $ replace = '' ) { $ oldPath = ( ! empty ( $ this -> url [ 'path' ] ) ? $ this -> url [ 'path' ] : '' ) ; switch ( $ type ) { case 'add' : $ path = $ oldPath . $ path ; break ; case 'remove' : $ path = str_replace ( $ path , '' , $ oldPath ) ; break ; case 'replace' : default : $ path = str_replace ( $ replace , $ path , $ oldPath ) ; break ; } $ this -> url [ 'path' ] = $ path ; return $ this ; }
Add or replace path

@param  string $path
@param  string $type
@param  string $replace
@return self
Add or replace path