<?php use yii\helpers\Url; use common\models\Exchange; use yii\widgets\ActiveForm; use yii\helpers\Html; use kartik\widgets\StarRating; use frontend\helpers\SetupSite; $USD = substr(SetupSite::getCurs("USD"),0); $EUR = substr(SetupSite::getCurs("EUR"),0); $UKR = substr(SetupSite::getCurs("UAH"),0); $Module = Yii::$app->getModule('shop'); $this->registerJsFile('/eshop/js/zoom-init.js', ['depends' => \frontend\assets\ShopAsset::className()]); $this->registerJsFile('/eshop/js/detail.js',['depends'=> \frontend\assets\ShopAsset::className()]); ?> <?php echo $this->render('/menu/_header', [ 'data' => $data, 'USD' => $USD, 'UKR' => $UKR, 'EUR' => $EUR, ]); //vd($data['currCurency']); switch ($data['currCurency']) { case 'RUB': $PRICE_1 = ''; $PRICE_2 = ' Руб'; $VALUTE = 1; break; case 'DOLLAR':
public function actionBlog() { $countPostOnPage = SetupSite::getParam('countPostOnPage'); $data = $this->getCommonDate(); $modelGoodsCategories = GoodsCategory::find()->all(); $modelBanner = Banner::find()->where(['status' => 0])->all(); $modelBrends = Brend::find()->all(); $modelBlog = Blog::find(); $countQuery = clone $modelBlog; $pages = new Pagination(['totalCount' => $countQuery->count(), 'defaultPageSize' => 3]); $models = $modelBlog->offset($pages->offset)->limit($countPostOnPage)->orderBy('created_at DESC')->all(); return $this->render('blog', ['models' => $models, 'pages' => $pages, 'data' => $data, 'modelGoodsCategories' => $modelGoodsCategories, 'modelBrends' => $modelBrends, 'modelBanner' => $modelBanner]); }