Пример #1
0
 public function init()
 {
     parent::init();
     // TODO: Change the autogenerated stub
     if ($this->type == 'mostViewed') {
         $this->title = Yii::t('app', 'Most Viewed');
         $this->models = Blog::mostViewed();
     }
     if ($this->type == 'latest') {
         $this->title = Yii::t('app', 'Latest Updates');
         $this->models = Blog::latest();
     }
     if ($this->type == 'random') {
         $this->title = Yii::t('app', 'Random Blog');
         $this->models = Blog::random();
     }
 }