Thursday, 20 February 2014

cakePHP App Class

If you want to use other models in a different controller, use App::import().
http://book.cakephp.org/2.0/en/core-utility-libraries/app.html
----------------------------------------------------------
public function index() {
      App::import('Model','User');
      $this->User= new User;
      $this->set('users', $this->User->find('all'));
}
----------------------------------------------------------

No comments:

Post a Comment