06.27 php saved
garrettheel
Tags add more
 
Note
garrettheel 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' => 'alphaNumeric',
  11.         'password' => 'alphaNumeric',
  12.         'email' => 'email'
  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.  
  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.  
  39. echo $form->end('Register');
  40.  
  41.  
  42.  
  43. ?>
Parsed in 0.070 seconds, using GeSHi 1.0.7.14

Modify this Paste