Blame view

protected/controllers/ReviewsController.php 926 Bytes
a1684257   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  <?php
  class ReviewsController extends NodeSiteController
  {
      public function actionIndex()
      {
          /** @var $reviewsRoot ReviewsRoot */
          $reviewsRoot = ReviewsRoot::model()->with('i18n')->findByPk($this->getNode()->data_id);
          
          $this->pageName = $reviewsRoot->i18n->page_name;
          $this->setSEOParams($reviewsRoot->i18n->title, $reviewsRoot->i18n->keywords, $reviewsRoot->i18n->description);
  
          
          $this->setContacts(explode(',', $reviewsRoot->contacts_data));
  
          
          $reviews = Review::model()->with('i18n')->findAll(array(
              'order' => 'date desc',
              'condition' => 'reviews_root_id = ' . $this->getNode()->data_id
          ));
          $this->headerGalleryId = $reviewsRoot->header_gallery_id;
          $this->render('index', array(
              'sidebar' => $reviewsRoot->i18n->sidebar_content,
              'reviews' => $reviews,
          ));
      }
  }