在yii2 gridview中,我有这段代码:
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn',
'options' => [
'width' => '40',
'label' => false,
'format' => 'raw',
],
],
'title',
[
'class' => 'yii\grid\ActionColumn',
'contentOptions' => [],
'header'=>'',
'template' => '{link}',
'buttons' => [
'link' => function ($url,$model,$key) use($url) {
return Html::a(Yii::t('app','app.Application job'), $url->url.'?application='.$model->id, ['class' => 'btn btn-application-button']);
},
],
'options' => ['width' => '60'],
],
],
]);
表格标题中的在网格视图中,正在生成带有一些URL地址的文本....
/职业/索引FIRST_STEP = PAGETITLE-60安培;排序=标题
网址已损坏且不必要,但我该如何删除它?而且只是文字?
这是表格中的代码:
<table class="table table-striped table-bordered">
<colgroup>
<col width="40" format="raw">
<col width="60"></colgroup>
<thead>
<tr>
<th>#</th>
<th><a href="/bg/career/index?first_step=%D0%BA%D0%B0%D1%80%D0%B8%D0%B5%D1%80%D0%B8-60&sort=title" data-sort="title">Позиция</a></th>
<th class="action-column"> </th>
</tr>
</thead>
.... //这是我想成为原始格式文本的链接
答案 0 :(得分:2)
尝试将sort = false分配给dataProvider ..例如:
$dataProvider['sort'=>false];
这应该禁用使用不需要的URL
调用的排序和排序