import/load a model in Cakephp


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (App::import('Model', 'Sheet')) {
  2. $this->Sheet = new Sheet();
  3. }
  4.  
  5.  
  6. // Update, Cakephp 1.3
  7. $this->loadModel('Article');
  8. $recentArticles = $this->Article->find('all', array('limit' => 5, 'order' => 'Article.created DESC'));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.