Example #1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     if (!$this->isShow() or !$this->model) {
         return false;
     }
     $renderer = \app\modules\banners\components\AbstractRenderer::getRenderer($this->model);
     if ($renderer) {
         return $renderer->render();
     }
 }
Example #2
0
<?php

/**
 * @var \app\modules\banners\models\Banner[] $models массив моделей баннеров
 * @var array $containerOptions массив атрибутов тега - контейнера
 */
use yii\helpers\Html;
echo Html::beginTag('ul', $containerOptions);
foreach ($models as $model) {
    echo Html::beginTag('li');
    $renderer = \app\modules\banners\components\AbstractRenderer::getRenderer($model);
    if ($renderer) {
        echo $renderer->render();
    }
    echo Html::endTag('li');
}
echo Html::endTag('ul');