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

To be able to get a route URL from its route name #3

Closed
khalyomede opened this issue Sep 12, 2020 · 1 comment
Closed

To be able to get a route URL from its route name #3

khalyomede opened this issue Sep 12, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@khalyomede
Copy link
Contributor

Description

Currently we duplicate the route URL both in the addGetRoute() method and in the view. A system associating a route with its name to be able to get the URL by the route name instead.

Expected behavior

To be able to register an optional name for the route:

use function Folded\addGetRoute;

addGetRoute("/", function() {}, "home.index");

To be able to get an URL by the route name:

use function getRouteUrl;
echo getRouteUrl("home.index"); // string (1) "/"

Actual behavior

No method to get an URL from the route name.

Alternatives solutions

Duplicating the URLs in the routes registration file and the view.

Notes

@khalyomede khalyomede added the enhancement New feature or request label Sep 12, 2020
@khalyomede khalyomede self-assigned this Sep 12, 2020
@khalyomede
Copy link
Contributor Author

Wrong project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant