Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR]: Add a global suffix to URL #14806

Closed
palcoder opened this issue Feb 4, 2020 · 1 comment
Closed

[NFR]: Add a global suffix to URL #14806

palcoder opened this issue Feb 4, 2020 · 1 comment
Labels
new feature request Planned Feature or New Feature Request

Comments

@palcoder
Copy link

palcoder commented Feb 4, 2020

Hello,

I think URL the class should have a method to add a global suffix to the URLs it generate. For example: we running an old system that should keep the suffix (.html) in the URL and we have to add it through controllers but if we implement this method it will allow us to add/remove the global suffix based on the app config.

Currently, we make a workaround by extending the URL class:

`
private $suffix;

public function get($uri = null, $args = null, bool $local = null, $baseUri = null): string
{
    return parent::get($uri, $args, $local, $baseUri) . $this->suffix;
}

public function getSuffix(): string
{
    return $this->suffix;
}

public function setSuffix(string $suffix)
{
    $this->suffix = $suffix;
}

public function removeSuffix()
{
    $this->setSuffix(null);
}

`

Also, it would be good to allow to override the staticBaseUri in the method getStatic by passing it as a second parameter which will allow us to easily change the base URI for some of the assets without the need to change the global config.

@palcoder palcoder added the new feature request Planned Feature or New Feature Request label Feb 4, 2020
@ruudboon
Copy link
Member

ruudboon commented Feb 4, 2020

Closing this in favour of #14608 (comment)

@ruudboon ruudboon closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants