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.
29 lines
510 B
29 lines
510 B
<?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 string $tag; |
|
public string $classes; |
|
public array $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, |
|
]); |
|
} |
|
} |