Пример #1
0
                <?php 
foreach ($hots as $item) {
    ?>
                    <li><?php 
    echo Html::a($item->title, ['/article/view', 'id' => $item->id]);
    ?>
</li>
                <?php 
}
?>
            </ul>
        </div>
    </div>
</div>
<?php 
echo \common\widgets\danmu\Danmu::widget(['id' => $model->id]);
$this->registerJsFile('@web/js/jquery.lazyload.min.js');
$this->registerJs(<<<js
    \$(function(){
        \$('.view-content iframe').addClass('embed-responsive-item').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');
        \$("img.lazy").show().lazyload({effect: "fadeIn"});
    });
js
);
if (stripos(Yii::$app->request->headers->get('User-Agent'), 'MicroMessenger22222') !== false) {
    $coverUrl = Yii::getAlias('@static') . '/' . $model->cover;
    $model->desc = empty($model->desc) ? mb_substr(trim(strip_tags($model->data->content)), 0, 150) : $model->desc;
    $appId = Yii::$app->params['wxAppId'];
    $appSecret = Yii::$app->params['wxAppSecret'];
    $weixin = new \common\models\Weixin();
    $accessToken = $weixin->getAccessToken($appId, $appSecret);
Пример #2
0
        <?php 
    foreach ($photos as $photo) {
        ?>
            <?php 
        echo $photo->box(100, 100);
        ?>
        <?php 
    }
    ?>
        <?php 
    Gallery::plugin();
    ?>
    </div>
    <br/>
<?php 
} else {
    ?>
    <p>Album is empty.</p>
<?php 
}
echo $album->pages();
echo $this->render('comment', ['model' => $album->model, 'commentModel' => $commentModel, 'commentModels' => $commentModels, 'pages' => $pages, 'commentDataProvider' => $commentDataProvider, 'commentNum' => $commentNum]);
echo \common\widgets\danmu\Danmu::widget(['id' => $album->model->category_id, 'comment_type' => 'gallery']);
/*$this->registerJsFile('@web/js/jquery.lazyload.min.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
$this->registerJs(<<<js
    $(function(){
        $('.view-content iframe').addClass('embed-responsive-item').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');
        $("img.lazy").show().lazyload({effect: "fadeIn"});
    });
js
);*/