示例#1
0
 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);
 }
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Revolutionslider::find(), 'pagination' => ['pageSize' => 20]]);
     return $this->render("index", ['dataProvider' => $dataProvider]);
 }
示例#4
0
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