コード例 #1
0
 protected function findModel($id)
 {
     if (($model = Revolutionslider::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
ファイル: Module.php プロジェクト: rocketyang/hasscms-app
 public function uninstall()
 {
     $models = Revolutionslider::find()->all();
     foreach ($models as $model) {
         $model->delete();
     }
     \Yii::$app->getDb()->createCommand()->dropTable(Revolutionslider::tableName())->execute();
     return true;
 }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: index.php プロジェクト: rocketyang/hasscms-app
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