<?php if ($item->category == "ALANÆ LIFE"): ?>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<article class="post img-thumbnail with-border post-list">
<div class="post-holder">
<div class="row">
<div class="col-md-8">
<figure>
<a href="<?= Url::to(["/post/index", 'id' => $item->id]) ?>">
<?php if(empty($item->img)):?>
<?= Html::img("@backend/web/images/store/no-images.jpg")?></a>
<?php endif?>
<?php
$file=Yii::getAlias('@app/web/img/box3.jpg');
$image=Yii::$app->image->load($file);
echo $image->resize(100,100);
?>
<?= Html::img("@backend/web/images/store/{$item->img}") ?></a>
<ul class="post-meta">
<li>
<a href="<?= Url::to(["/post/index", 'id' => $item->id]) ?>">
<em><?= mb_substr($item->date, 8, 2, 'UTF-8')?></em>
<em>
<?php
$dateObj = \DateTime::createFromFormat('!m', mb_substr($item->date, 5, 2));
echo mb_substr($dateObj->format('F'), 0, 3);
?>
</em>
</a>
</li>
</ul>
</figure>
</div>
<div class="col-md-4">
<div class="post-head">
<h2>
<a href="<?= Url::to(["/post/index", 'id' => $item->id]) ?>">
<?php switch (Yii::$app->language): case"ru-RU": ?>
<?= $item->title_ru ?>
<?php break ?>
<?php
case"en-US":
?>
<?= $item->title_en ?>
<?php break ?>
<?php
case
"ir-IR":
?>
<?= $item->title_ir ?>
<?php break ?>
<?php endswitch?>
</a></h2>
</div>
<div class="description">
<p>
<?php switch (Yii::$app->language): case"ru-RU": ?>
<?= mb_substr('<p>' . $item->text_ru . '</p>', 0, 300, 'UTF-8') . ' <b>. . . </b>'; ?></p>
<?php break ?>
<?php
case"en-US":
?>
<?= mb_substr('<p>' . $item->text_en . '</p>', 0, 300, 'UTF-8') . ' <b>. . . </b>'; ?></p>
<?php break ?>
<?php
case
"ir-IR":
?>
<?= mb_substr('<p>' . $item->text_ir . '</p>', 0, 300, 'UTF-8') . ' <b>. . . </b>'; ?></p>
<?php break ?>
<?php endswitch?>
</p>
</div>
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-frontend',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'frontend\controllers',
'components' => [
'urlManagerBack' => [
'class' => 'yii\web\UrlManager',
'baseUrl' => 'localhost/fashion-house',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => require(__DIR__ . '/../../backend/config/main.php'), //тут путь к файлу с rules для backend
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
],
'params' => $params,
];
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [],
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
],
'params' => $params,
];