This tutorial will help you to learn how to create rest api in cakephp. For this we need to follow the following steps:
Step1: Create a database and a table say "users"
Step2: Now we will create the Users Model, Veiw and Controller.
Step3: Create a restful controller: RestUsersController.php
- Read the complete Blog at: Creating RESTful API in Cakephp
FindNerd’s Php questions and answers forum is developed for those tech geeks who don’t want to wait for a longer duration of time, as the community members within FindNerd can answer any android query within shortest possible time frame.
Apart from this, If you have any language query like C, Java, JavaScript, iOS, Html, PHP etc . you can post at FindNerd’s Java developer Forum
Step1: Create a database and a table say "users"
Step2: Now we will create the Users Model, Veiw and Controller.
- users model:
- class User extends AppModel {
- }
Step3: Create a restful controller: RestUsersController.php
- <?php
- class RestUsersController extends AppController {
- public $uses = array('User');
- public $helpers = array('Html', 'Form');
- public $components = array('RequestHandler');
- public function index() {
- $users = $this->User->find('all');
- $this->set(array(
- 'users' => $users,
- '_serialize' => array('users')
- ));
- }
- public function add() {
FindNerd’s Php questions and answers forum is developed for those tech geeks who don’t want to wait for a longer duration of time, as the community members within FindNerd can answer any android query within shortest possible time frame.
Apart from this, If you have any language query like C, Java, JavaScript, iOS, Html, PHP etc . you can post at FindNerd’s Java developer Forum
No comments:
Post a Comment