All pastes #195887 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-10-10 04:02 UTC
rendered paste body
         1 <?php                                                                                                                                                                                                 
         2         class ContactsController extends AppController {                                                                                                                                              
         3                 var $name = 'Contacts';                                                                                                                                                               
         4                                                                                                                                                                                                       
         5                 function index() {                                                                                                                                                                    
         6                         //currently this will only list the contacts you have personally added                                                                                                        
         7                         $current_user = $this->Session->read('User');                                                                                                                                 
         8                         $this->Contact->unbindModel(array('belongsTo' => array('User')));                                                                                                             
         9                         $this->set('contacts', $this->Contact->findAllByUser_Id($current_user['id']));                                                                                                
        10                 }                                                                                                                                                                                     
        11         }                                                                                                                                                                                             
        12 ?>