Beispiel #1
0
 protected function findModelBySlug($slug)
 {
     if (($model = Slider::findOne(['name' => $slug])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException();
     }
 }
Beispiel #2
0
 public function init()
 {
     parent::init();
     if (!$this->id) {
         $sliderId = \app\modules\slider\models\backend\Slider::findOne(['name' => $this->name]);
         $this->id = $sliderId->id;
     }
     Html::addCssClass($this->options, ['widget' => 'hidden widget-slider-' . $this->id]);
 }
Beispiel #3
0
 protected function findSlider($id)
 {
     if (($model = Slider::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }