Monday, April 20, 2015

Re: How to separate website code as per as restfull webservice code base within cakephp3.0

Hi

Take a look at Prefix Routing at http://book.cakephp.org/3.0/en/development/routing.html#prefix-routing.

You can use this to provide regular website actions, and REST actions that might be prefixed with api_, if the actions themselves need to return different results.

If the actions are returning the same basic data, you could use the Request Handler to serialize for AJAX requests that would be issued by the Mobile App.

That would be a combination of http://book.cakephp.org/3.0/en/controllers/components/request-handling.html, http://book.cakephp.org/3.0/en/views/json-and-xml-views.html and http://book.cakephp.org/3.0/en/development/rest.html.

I've been a little out of touch with CakePHP 3, and havent had the opportunity to do any new development with it, however, I believe these references still roughly apply for CakePHP 2.0 as well.

Regards
Reuben Helms

On Monday, 20 April 2015 18:10:02 UTC+10, brijkishor rajput wrote:

I am creating a website using cakephp3.0 . here is 2 section

1) Website 2) rest-full Web-service for mobile app

I do not know how to create both thing within single project because for this i need to create separate model and controller for both. so I want to know .How can do it in cakephp3.0

I think , I need to create separate module for web-service suppose I have a user section so please tell me how to I can create both ?

I am very new on cakephp3.0

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: