Poll: REST support? You do not have permission to vote in this poll. |
|||
yes | 71 | 84.52% | |
no | 8 | 9.52% | |
maybe | 5 | 5.95% | |
Total | 84 vote(s) | 100% |
* You voted for this item. | [Show Results] |
REST support |
(04-15-2015, 02:35 AM)sv3tli0 Wrote: Yes but it will be pointless to make anything more than an Interface and a rest router definition as all methods has to be covered 1 by 1 by devs. I agree with this, I prefer a CI extension support and keep the core as uncluttered as possible. It could still be a "Official" extension created by the core team.
The following site does a really decent job explaining what REST is and gives a good example of what a RESTful API could look like: source: http://coreymaynard.com/blog/creating-a-...-with-php/
Their is not just one API and there is certainly no API suitable for all situations. CodeIgniter could offer some kind of 'all purpose API' which would suit most situations, like handling simple CRUD actions, BUT ... CodeIgniter is a MVC-framework in which people are free to choose what their controller actions look like. So you should create a special kind of controller (RESTController?) or a controller which implements THE CodeIgniter RESTful interface. I don't think that is the way to go and I agree with the last two comments. I really wonder how many of the voters created a RESTful API them self. Or were the voters thinking "REST is cool so CodeIgniter must support it?" And another thing. REST has nothing to do with ORM ;-)
IMO having a separate Rest_Controller all together is not good, response formatter seems like good idea Yii has something similar, we need more input from the community.
Combination of some kind of special Route REST setting (where you just match url <=> controller) + REST Controller Interface is an option ..
(all default rest paths has to match this controller actions if exists else 404) Laravel have good experience at that.. How ever all actions in the controller are custom matching your resources and there can't be any default version for defining Trait or Abstract controller or REST_Controller.. Best VPS Hosting : Digital Ocean
REST is very important nowadays for a modern framework.
I think that REST service could have a separate controller handling, also because a separate controller for REST should be integrated with the routing part of the framework. I explain it. For example ([pseudo-pseudo]-code ) Code: class Posts extends Codeigniter\Controller\RestController { In this case, the routing could be automatic: GET posts/index PUT posts/index POST posts/insert and so on. What do you think about it? |