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]])]); }
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]); }
?> "> </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++;
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()]); }