protected function findModel($id) { if (($model = Revolutionslider::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function uninstall() { $models = Revolutionslider::find()->all(); foreach ($models as $model) { $model->delete(); } \Yii::$app->getDb()->createCommand()->dropTable(Revolutionslider::tableName())->execute(); return true; }
public function renderItems() { $options = $this->itemOptions; $tag = ArrayHelper::remove($options, 'tag', 'li'); $lines = []; $items = \hass\revolutionslider\models\Revolutionslider::find()->all(); if (!empty($items)) { RevolutionsliderAsset::register($this->view); } foreach ($items as $item) { $menu = $this->renderItem($item); if ($tag === false) { $lines[] = $menu; } else { $lines[] = Html::tag($tag, $menu, $options); } } return implode("\n", $lines); }
use yii\helpers\Html; use hass\frontend\models\Post; /* @var $this yii\web\View */ ?> <!-- Section --> <section class="section full-width-bg"> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <!-- Revolution Slider --> <div class="tp-banner-container main-revolution"> <span class="Apple-tab-span"></span> <div class="tp-banner"> <ul> <?php $models = Revolutionslider::find()->all(); ?> <?php foreach ($models as $model) { ?> <li data-transition="papercut" data-slotamount="7"> <?php if ($attachment = $model->thumbnail) { echo Html::img($attachment->getUrl()); } ?> <?php /* @var $caption \hass\revolutionslider\models\CaptionForm */ ?> <?php