public function actionGallery() { if (!Yii::$app->request->get('slug')) { return $this->render('gallery'); } $category = Gallery::cat(Yii::$app->request->get('slug')); return $this->render('gallery-item', ['category' => $category]); }
public function actionView($slug) { $album = Gallery::cat($slug); if (!$album) { throw new \yii\web\NotFoundHttpException('Album not found.'); } return $this->render('view', ['album' => $album, 'photos' => $album->photos(['pagination' => ['pageSize' => 4]])]); }
?> "> </div> <?php $i++; } ?> </div> </div> </div> <div class="col-md-3 no-padding"> <div id="carousel-example-generic-8" class="carousel slide mini-slider carousel-fade" data-ride="carousel"> <div class="carousel-inner" role="listbox"> <?php $i = 0; foreach (Gallery::last(5, ['item_id' => Gallery::cat('gallery8')->model->category_id]) as $photo) { ?> <div class="item <?php echo $i == 0 ? 'active' : ''; ?> "> <img src="<?php echo $photo->image; ?> " alt="<?php echo $photo->alt(); ?> "> </div> <?php $i++;
<hr/> <div class="text-center"> <h2>Last photos</h2> <br/> <?php foreach (Gallery::last(6) as $photo) { ?> <?php echo $photo->box(180, 135); ?> <?php } ?> <?php Gallery::plugin(); ?> </div> <br/> <hr/> <div class="text-center"> <h2>Last news</h2> <blockquote class="text-left"> <?php echo Html::a(News::last()->title, ['news/view', 'slug' => News::last()->slug]); ?> <br/> <?php echo News::last()->short;
use yii\easyii\modules\gallery\api\Gallery; use yii\easyii\modules\page\api\Page; use yii\helpers\Html; use yii\helpers\Url; $page = Page::get('page-gallery'); $this->title = $page->seo('title', $page->model->title); $this->params['breadcrumbs'][] = $page->model->title; ?> <h1><?php echo $page->seo('h1', $page->title); ?> </h1> <br/> <?php foreach (Gallery::cats() as $album) { ?> <a class="center-block" href="<?php echo Url::to(['gallery/view', 'slug' => $album->slug]); ?> "> <?php echo Html::img(Image::thumb($album->image, 160, 120)); ?> <br/><?php echo $album->title; ?> </a> <br/> <?php }
</a> <span class="date">[<?php echo $news->date; ?> ]</span> </li> <?php } ?> </ul> </div> </div> <div class="col col-5"> <div class="photogallery"> <?php foreach (Gallery::cats() as $cat) { ?> <a class="preview" href="<?php echo Yii::$app->urlManager->createUrl(['site/gallery', 'slug' => $cat->slug]); ?> "> <img src="<?php echo $cat->image; ?> " style="width: 150px; height: 100px"> <div class="title"><?php echo $cat->title; ?> </div> </a> <?php
use yii\easyii\modules\gallery\api\Gallery; use yii\easyii\modules\guestbook\api\Guestbook; use yii\easyii\modules\news\api\News; use yii\easyii\modules\page\api\Page; use yii\easyii\modules\text\api\Text; use yii\helpers\Html; use yii\easyii\models\Setting; use app\modules\awarness\api\Feedback as Awarness; $page = Page::get('about'); $this->title = $page->seo('title', $page->model->title); use yii\widgets\ActiveForm; ?> <div class="content"> <?php foreach (Gallery::last(1, ['item_id' => Gallery::cat('awarness-gallery')->model->category_id]) as $photo) { ?> <img class="img-responsive" src="<?php echo $photo->image; ?> "> <?php } ?> <div class="container"> <div class="row"> <div class="col-md-12"> <?php $page = Page::get('know-more-about-us');
public function actionGallery() { $gallery = Gallery::cat('fotoalbom'); return $this->render('gallery', ['photos' => $gallery->photos()]); }