roots / acorn

Laravel components for WordPress plugins and themes
https://roots.io/acorn/
MIT License
819 stars 94 forks source link

Routing on this beautiful framework #68

Closed smarteist closed 1 year ago

smarteist commented 4 years ago

Hello, thank you for the efforts of the programmers of this framework, I have a suggestion for adding "router" to make this framework powerful, I've written a router inspired by Laravel that might be helpful. here

plumthedev commented 3 years ago

I think is router for pages is not necessary. Better solution is router for AJAX actions and Rest API actions. Wordpress has good enough router system for pages, templates etc.

QWp6t commented 1 year ago

Routing was added as an experimental feature in #249. 🎉

You'll need to add the following environment variable.

ACORN_ENABLE_EXPIRIMENTAL_ROUTER=true

There are currently no docs for this, but the short version is that you'll have to create routes/web.php and add some routes.