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

[Wish list]Creating routes automatically from templates #357

Closed
yuki-kimoto opened this issue Jul 20, 2012 · 6 comments
Closed

[Wish list]Creating routes automatically from templates #357

yuki-kimoto opened this issue Jul 20, 2012 · 6 comments

Comments

@yuki-kimoto
Copy link
Contributor

Approach like PHP is very easy.
routes and controller is no need.
when template is created, routes is created automatically from template path.

TEMPLATES                ROUTES
 /foo.html.ep                 /foo
 /foo/bar.html.ep          /foo/bar 
 /foo/bar/baz.html.ep   /foo/bar/baz 

How about Mojolicious::Plugin::AutoRoute idea in core.
http://search.cpan.org/~kimoto/Mojolicious-Plugin-AutoRoute-0.01/lib/Mojolicious/Plugin/AutoRoute.pm

@kraih
Copy link
Member

kraih commented Jul 20, 2012

Why should this be in core when it can be a plugin on CPAN? What's the gain?

@MadMartigan
Copy link

Interesting. I suppose the gain would be ease of use for new users (especially from the PHP world) which might in turn enhance the initial experience. However, I've not heard anyone else ask for this even though it's a neat idea. Seems to me that a plugin is sufficient unless confusion over dynamically generated routes becomes a hot topic or a much requested feature.

@kraih
Copy link
Member

kraih commented Jul 20, 2012

-1 from me. Maybe in the future if the plugin becomes popular, but for now i don't see much value in adding it to core instead of leaving it on CPAN.

@yuki-kimoto
Copy link
Contributor Author

I provided one idea because Mojolicious was seekking for simple usage until now.
I think that If user create Mojolicious application by only templates(and application class), PHP user use Mojolicious more easily.

@tempire
Copy link
Contributor

tempire commented Jul 20, 2012

I'd be more apt to consider this feature if it was requested often, but this is the first I've heard of it.

Seems better to leave it in an optional plugin since it's not a common request.

@marcusramberg
Copy link
Member

I'm a bit worried about unintended side effects from enabling this by default. Some templates aren't meant to be dispatched to, and could cause security issues. It seems like a nice enough feature if you enable it explicitly tho. I also think it belongs as a CPAN module for now.
-1

@kraih kraih closed this as completed Jul 20, 2012
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

5 participants