Exemple #1
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use app\modules\home\models\Album;
$albumUrl = Url::toRoute(['/user/view/view-album', 'id' => $model['id']]);
$src = Album::getCoverPhoto($model['id'], $model['cover_id']);
$name = Html::encode($model['name']);
$status = $model['status'] != Album::TYPE_PUBLIC ? '<i class="glyphicon glyphicon-lock"></i>' : '';
?>
<div class="album-img">
    <a href="<?php 
echo $albumUrl;
?>
">
        <img src="<?php 
echo $src;
?>
" class="album-cover" alt="album-cover">
    </a>
</div>
<div class="album-info">
	<div class="album-desc">
		<div class="album-desc-side"><?php 
echo $status;
?>
</div>
		<div class="album-tit">
			<?php 
echo Html::a($name, $albumUrl, ['class' => 'album-name']);
?>
Exemple #2
0
        <div class="e-album-all">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <?php 
echo Yii::t('app', 'Albums');
?>
                    <?php 
echo Html::a(Yii::t('app', 'More'), ['/explore/photos'], ['class' => 'pull-right']);
?>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <?php 
if ($this->beginCache('explore-album', ['duration' => 3600])) {
    foreach ($albums as $album) {
        $coverSrc = Album::getCoverPhoto($album['id']);
        $link = Url::toRoute(['/explore/view-album', 'id' => $album['id']]);
        ?>
                                    <div class="album-item col-md-3 col-sm-6">
                                        <div class="album-img">
                                            <a href="<?php 
        echo $link;
        ?>
">
                                                <img src="<?php 
        echo $coverSrc;
        ?>
" class="album-cover" alt="album-cover">
                                            </a>
                                        </div>
                                        <div class="album-info">