public function actionView($alias, $lang = null, $category = null) { $model = EventsRecord::find()->lang($lang)->joinWith(['category', 'images'])->andWhere([CategoryRecord::tableName() . '.alias' => $category])->andWhere([EventsRecord::tableName() . '.alias' => $alias])->one(); if (!$model) { throw new HttpException('404', 'Запись не найдена'); } return $this->render('view', ['model' => $model]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = EventsRecord::find()->lang(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'categoryId' => $this->categoryId, 'dateCreate' => $this->dateCreate, 'dateUpdate' => $this->dateUpdate]); $query->andFilterWhere(['like', 'lang', $this->lang])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'alias', $this->alias])->andFilterWhere(['like', 'descriptionShort', $this->descriptionShort])->andFilterWhere(['like', 'descriptionFull', $this->descriptionFull])->andFilterWhere(['like', 'metaKeywords', $this->metaKeywords])->andFilterWhere(['like', 'metaDescription', $this->metaDescription]); return $dataProvider; }
?> " alt="" class="logo-footer"> <div class="footer-share"> <a href="https://www.facebook.com/darhanbusinesscenter" target="_blank"><span class="fa fa-facebook"></span></a> <a href="https://www.instagram.com/darhan_uz" target="_blank"><span class="fa fa-instagram"></span></a> <!-- <a href="#"><span class="fa fa-twitter"></span></a>--> </div> </div> </div> <div class="col-lg-4 col-md-4 col-sm-6 col-sm-6 no-padding"> <div class="footer-block"> <h6>Последние новости</h6> <?php foreach (\app\modules\article\models\EventsRecord::getFromCategory('news') as $item) { ?> <div class="f_news clearfix"> <a class="f_news-img black-hover" href="<?php echo $item->url; ?> "> <img class="img-responsive" src="<?php echo $item->imageSrc('86x76', \yii\image\drivers\Image::CROP); ?> " alt=""> <div class="tour-layer delay-1"></div> </a> <div class="f_news-content"> <a class="f_news-tilte color-white link-red" href="<?php
public function getEventsCount() { return $this->hasMany(EventsRecord::className(), ['categoryId' => 'id'])->lang()->count(); }
<?php /** * @var $this \yii\web\View */ use yii\image\drivers\Image as Img; use yii\helpers\Url; use app\modules\catalog\models\CategoryRecord; $this->title = 'Главная'; $blogList = \app\modules\article\models\EventsRecord::getFromCategory('informaciya'); ?> <!-- Slider --> <div id="magik-slideshow" class="magik-slideshow"> <div id="rev_slider_4_wrapper" class="rev_slider_wrapper fullwidthbanner-container"> <div id="rev_slider_4" class="rev_slider fullwidthabanner"> <ul> <li data-transition="random" data-slotamount="7" data-masterspeed="1000" data-thumb="<?php echo $this->theme->getUrl('assets/images/is/slider/2.jpg'); ?> "><img src="<?php echo $this->theme->getUrl('assets/images/is/slider/1.jpg'); ?> " data-bgposition="left top" data-bgfit="cover" data-bgrepeat="no-repeat" alt=""/> <div class="tp-caption LargeTitle sfl tp-resizeme " data-x="45" data-y="140" data-endspeed="500" data-speed="500" data-start="1300"