bakaphp / router

A tool to create multiple Phalcon Collections with easy.
https://bakaphp.github.io/router
MIT License
4 stars 1 forks source link

Make useRestConvention a chaining method #23

Closed gabbanaesteban closed 3 years ago

gabbanaesteban commented 5 years ago

Is your feature request related to a problem? Please describe. If I want to create a get route using rest convention, I have to:

Long way:

Route::get('book-insights')->controller('BookInsightController');
Route::get('book-insights/{id}')->controller('BookInsightController')->action('getById');

Shorter way:

Route::add('book-insights')->controller('BookInsightController')->via(Http::GET);

Describe the solution you'd like

Ability to set wheter use restConvention or not as a chaining method

Route::get('book-insights')->controller('BookInsightController')->restConvention(true);

Describe alternatives you've considered None

Additional context The "Shorter way" isn't an official solution, it wasn't planned to work like that, it was just luck.

gabbanaesteban commented 5 years ago

What do u think @kaioken @DannyFeliz ?