Welcome Guest, Not a member yet? Register   Sign In
Poll: REST support?
You do not have permission to vote in this poll.
yes
84.52%
71 84.52%
no
9.52%
8 9.52%
maybe
5.95%
5 5.95%
Total 84 vote(s) 100%
* You voted for this item. [Show Results]

REST support
#17

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 Smile )


Code:
class Posts extends Codeigniter\Controller\RestController {
   public function get_index() {
       $this->response('json')->print('this is the response for GET request');
   }

   public function put_index() {
       $this->response('json')->print('this is the response for PUT request');
   }

   public function post_insert() {
       $this->response8'json')->print(this is the response for POST request for the action insert');

   // other methods
}

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?
Reply


Messages In This Thread
REST support - by jlp - 04-11-2015, 08:31 AM
RE: REST support - by sv3tli0 - 04-11-2015, 11:08 PM
RE: REST support - by jiang.tao - 04-12-2015, 04:34 PM
RE: REST support - by ciadmin - 04-12-2015, 07:48 PM
RE: REST support - by cjj - 04-12-2015, 07:13 PM
RE: REST support - by mimo - 04-15-2015, 12:09 AM
RE: REST support - by mwhitney - 04-13-2015, 12:53 PM
RE: REST support - by sv3tli0 - 04-15-2015, 01:01 AM
RE: REST support - by ciadmin - 04-15-2015, 01:15 AM
RE: REST support - by sv3tli0 - 04-15-2015, 02:35 AM
RE: REST support - by djm56a - 04-15-2015, 03:33 AM
RE: REST support - by RWCH - 04-15-2015, 05:51 AM
RE: REST support - by alkarim - 04-22-2015, 08:24 AM
RE: REST support - by RWCH - 04-28-2015, 09:25 AM
RE: REST support - by light25 - 05-03-2015, 10:03 PM
RE: REST support - by sv3tli0 - 05-04-2015, 06:30 AM
RE: REST support - by Release - 03-21-2016, 03:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB