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

Expose named routes #8

Open
davist11 opened this issue Jul 7, 2020 · 1 comment
Open

Expose named routes #8

davist11 opened this issue Jul 7, 2020 · 1 comment

Comments

@davist11
Copy link
Contributor

davist11 commented Jul 7, 2020

https://github.com/craft-snippets/craft-named-routes

Maybe expose them all as global variables prefixed with route or a routeUrl twig function?

{{ routePressReleases }}

{{ routeUrl('name', { userId: 1 }) }}
@davist11 davist11 transferred this issue from vigetlabs/craft-starter-module Sep 18, 2020
@davist11
Copy link
Contributor Author

Craft::$app->urlManager->rules is how we would access any routes defined in the routes.php and in the CP

And then in order to access section routes, we would have to get all the sections Craft::$app->sections->allSections and see which sections have URLs available.

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

No branches or pull requests

1 participant