You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
7 years ago
|
<?php
|
||
|
|
||
|
use core\entities\Search;
|
||
|
use yii\helpers\Html;
|
||
|
use yii\grid\GridView;
|
||
|
use yii\helpers\StringHelper;
|
||
|
|
||
|
/* @var $this yii\web\View */
|
||
|
/* @var $provider yii\data\ActiveDataProvider */
|
||
|
/* @var $form \core\forms\SearchForm */
|
||
|
|
||
|
$title = Yii::t('main', 'Search results');
|
||
|
$this->title = $title . ' > ' . Html::encode($form->query);
|
||
|
$this->params['breadcrumbs'][] = $title;
|
||
|
?>
|
||
|
<div class="blog-post-index">
|
||
|
|
||
|
<div class="box">
|
||
|
<div class="box-body">
|
||
|
<?= GridView::widget([
|
||
|
'dataProvider' => $provider,
|
||
|
'showHeader' => false,
|
||
|
'options' => [
|
||
|
'style' => 'word-wrap:break-word;',
|
||
|
],
|
||
|
'tableOptions' => [
|
||
|
'class' => 'table',
|
||
|
],
|
||
|
'columns' => [
|
||
|
[
|
||
|
'attribute' => 'title',
|
||
|
'value' => function (Search $model) {
|
||
|
return Html::a(Html::tag('h3', $model->title), [$model->url]) . StringHelper::truncateWords(strip_tags($model->content), 60, '...');
|
||
|
},
|
||
|
'format' => 'raw',
|
||
|
],
|
||
|
],
|
||
|
]); ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|