echo $article->id; ?> " class="post"> <h2 class="post-title"> <?php echo \yii\helpers\Html::a($article->title, $um->createUrl(['blog/single', 'uri' => $article->category->uri, 'id' => $article->id])); ?> </h2> <img src="/<?php echo $article->getImage()->getPath(); ?> " height="280" width="580" alt="no-photo"> <p class="article-description"><?php echo Tool::getContent($article->content); ?> </p> <p> <?php echo \yii\helpers\Html::a('Дізнатися більше', $um->createUrl(['blog/single', 'uri' => $article->category->uri, 'id' => $article->id]), ['class' => 'button']); ?> <p> </article> <?php } ?> <?php
<h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('Додати сторінку', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'name', 'format' => 'raw', 'value' => function ($model) { if ($model->status) { $host = Yii::$app->request->hostInfo; $url = $host . '/' . $model->uri; return Html::a($model->name, Url::to($url), ['target' => '_blank']); } return $model->name; }, 'contentOptions' => ['style' => 'font-weight: bold; width: 250px;']], ['attribute' => 'content', 'value' => function ($model) { return Tool::getContent($model->content); }, 'contentOptions' => ['style' => 'width: 510px']], 'created', 'updated', ['attribute' => 'status', 'value' => function ($model) { return $model->status ? 'Опубліковано' : 'В черзі'; }], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['width' => '30']]]]); ?> </div>