<?php
namespace frontend\widgets;

use yii\base\Widget;

class Slider extends Widget
{
    public $title;

    public function init(){

        parent::init();

    }


    public function run()
    {


            $slider = \common\models\Slider::find()->where([\common\models\Slider::tableName().'.title'=>$this->title])->joinWith("sliderImage")->one();
            if($slider instanceof  \common\models\Slider){
                return $this->render('slider',[
                    'slider'=>$slider,
                    'title'=>$this->title
                ]);

            }


    }

}