Beispiel #1
0
<?php

/** @var \app\models\Video $videos */
/** @var \app\models\PhotoCatalog $photos */
/** @var \yii\web\View $this */
use app\components\MyHelper;
use evgeniyrru\yii2slick\Slick;
use yii\helpers\Html;
use yii\web\JsExpression;
?>

<?php 
$dataPage = \app\models\MainPage::findOne(1);
$this->title = $dataPage->meta_title;
//    $this->registerMetaTag([
//        'name' => 'keywords',
//        'content' => $dataPage->meta_keywords
//    ]);
$this->registerMetaTag(['name' => 'description', 'content' => $dataPage->meta_description]);
?>

<div class="g w1140 main">
<!-- slider -->
<div class="herounit blue-gradient-bg">
    <div class="g w1140 slider">
        <a href="#"><img class="r" src="/images/slide-01.png" alt=""></a>
        <?php 
//        $images = [
//            Html::a(Html::img("http://goods.marketgid.com/img/new-year.jpg", ['alt' => 'Для праздников и карнавалов', 'title' => 'Для праздников и карнавалов']), ['category/dla_prazdnikov_i_karnavalov/2054']),
//            Html::a(Html::img("http://goods.marketgid.com/img/appliances.png", ['alt' => 'Бытовая техника', 'title' => 'Бытовая техника']), ['category/bytovaa_tehnika/8']),
//            Html::a(Html::img("http://goods.marketgid.com/img/auto.png", ['alt' => 'Автотовары', 'title' => 'Автотовары']), ['category/avto_velo_moto/6']),
Beispiel #2
0
 /**
  * Finds the MainPage model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MainPage the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MainPage::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }