/** * Finds the Exclusives model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Exclusives the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Exclusives::find()->with('properties')->where(['id' => $id])->one()) !== null) { return $model; } else { throw new NotFoundHttpException('Запрошенная страница не найдена.'); } }
/** * Finds the Exclusives model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Exclusives the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Exclusives::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
echo Html::a('Показать все', ['exclusives/index'], ['class' => 'btn btn-primary']); ?> <div class="btn-group" data-toggle="buttons"> <?php if (!$active && $houses > 0 || $active) { echo Html::a('Дом', ['exclusives/house'], ['class' => 'btn btn-default' . ($active === 'house' ? ' active' : '')]); } if (!$active && $flats > 0 || $active) { echo Html::a('Квартира', ['exclusives/flat'], ['class' => 'btn btn-default' . ($active === 'flat' ? ' active' : '')]); } ?> </div> <div class="btn-group" data-toggle="buttons"> <?php if ($filters = Exclusives::getRoomFilters()) { foreach ($filters as $count) { echo Html::a($count . '-комнатные', ['exclusives/rooms', 'count' => $count], ['class' => 'btn btn-default' . ($active === 'rooms' . $count ? ' active' : '')]); } } ?> </div> </div> <div id="exclusive-items"> <?php $rows = array_chunk($exclusives, 4); foreach ($rows as $exclusives) { echo Html::beginTag('div', ['class' => 'row']); foreach ($exclusives as $key => $item) { ?> <div class="col-md-3">