About

Breaking

Tuesday 9 May 2017

how to create add file


         

                          Model
                  <?php
                   class User extends AppModel{}


                  

                         Controller

                <?php
             class UsersController extends AppController{

                     public function add(){
                   if($this->request->is('post')){
                    $this->User->create();
                    $this->User->save($this->request->data);
                   }

          }





ADD.CTP
<h2>user add </h2>
<?php
echo $this->Form->create('User');
echo $this->Form->input('name');
echo $this->Form->input('password');
echo $this->Form->input('full_name');
echo $this->Form->end('submit');


No comments:

Post a Comment