06.28 php saved
XantoM
Tags add more
 
Note
XantoM did not leave a note
  1. <?php
  2.  
  3. // User Model
  4.  
  5. class User extends AppModel
  6. {
  7.     public $name = 'User';
  8.    
  9.     public $validate = array(
  10.         'username' => array('rule' => 'alphaNumeric', 'allowEmpty'=>false),
  11.         'password' => array('rule' => 'alphaNumeric', 'allowEmpty'=>false),
  12.         'email' => array('rule' => 'email', 'allowEmpty'=>false)
  13.         );
  14. }
  15.  
  16. // Register function within User Controller
  17.  
  18.     function register()
  19.     {
  20.         if (!empty($this->data))
  21.         {
  22.             if ($this->User->save($this->data))
  23.             {
  24.                 $this->Session->setFlash('Your registration information was accepted.');
  25.             }
  26.         }  
  27.     }
  28.  
  29. // Register view
  30.  
  31. echo $form->create('User', array('action' => 'register'));
  32. <div>
  33. echo $form->input('first_name');
  34. echo $form->input('last_name');
  35. echo $form->input('username');
  36. echo $form->input('email');
  37. echo $form->input('password');
  38. </div>
  39. echo $form->end('Register');
  40.  
  41.  
  42.  
  43. ?>
Parsed in 0.092 seconds, using GeSHi 1.0.7.14

Modify this Paste