You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
491 B

7 years ago
<?php
/**
* Created by Error202
* Date: 27.01.2018
*/
namespace frontend\widgets\slider;
use core\entities\Slider;
use yii\base\Widget;
class SliderWidget extends Widget
{
public $tag;
public $classes;
public $attrs;
public function run(): string
{
$slider = Slider::find()->orderBy(['sort' => SORT_ASC])->all();
return $this->render('slider', [
'slider' => $slider,
'tag' => $this->tag ?: 'div',
'classes' => $this->classes,
'attrs' => $this->attrs,
]);
}
}