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

Url helper #10721

Open
risalfajar opened this issue Sep 13, 2023 · 0 comments
Open

Url helper #10721

risalfajar opened this issue Sep 13, 2023 · 0 comments
Labels
feature / enhancement New feature or request

Comments

@risalfajar
Copy link

risalfajar commented Sep 13, 2023

Describe the problem

Currently, there's no way to create a link relative to the page/layout in which it is used, all links must be absolute. This has 2 problems:

  1. It's painful to write links in deeply nested page/layout, let alone if it has multiple slugs.
  2. It's painful to maintain those links, since one change in the parent route can break all children links.

Describe the proposed solution

Routify resolve this nicely with Url helper.

To quote them:

$url resolves paths relative to the page/layout file in which it is used. This ensures consistent URLs that are unaffected by the current browser address (unlike normal relative URLs).
You can also call the function $url() on any page to get the current path.

We can borrow their implementation.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

Related issues:
#822
#10708

@eltigerchino eltigerchino added the feature / enhancement New feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants