コード例 #1
0
ファイル: ItemsController.php プロジェクト: besimhu/legacy
 public function view($slug = '', $id = null)
 {
     // $slug is throwaway, it's just used for SEO.
     $m = ClassRegistry::init('News.AttachmentsItem');
     $attachments = $m->findAllByItemId($id);
     foreach ($attachments as &$a) {
         $meta = ClassRegistry::init('News.Metadatum');
         $a['Metadata'] = $meta->findAllByAttachmentId($a['Attachment']['id']);
     }
     $this->set(compact('attachments'));
     parent::view($id);
 }
コード例 #2
0
 function index($year = null, $month = null)
 {
     if ($year && $month) {
         $this->paginate['conditions'] = array('NewsArticle.date >=' => $year . '-' . $month . '-1', 'NewsArticle.date <=' => $year . '-' . $month . '-31');
     } elseif ($year) {
         $this->paginate['conditions'] = array('NewsArticle.date >=' => $year . '-1-1', 'NewsArticle.date <=' => $year . '-12-31');
     }
     if (Configure::read('News.layout')) {
         $this->layout = Configure::read('News.layout');
     } else {
         $this->layout = 'default';
     }
     return parent::index();
 }
コード例 #3
0
ファイル: PagesController.php プロジェクト: besimhu/legacy
 public function beforeFilter()
 {
     parent::beforeFilter();
     //$this->Auth->allow('display');
 }