yii2 GridView header link 删除
yii2 GridView header link remove
在 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'],
],
],
]);
in header of table 在网格视图中,正在生成带有一些 url 地址的文本....
/career/index?first_step=pagetitle-60&sort=title
Url 已损坏且不需要,但如何删除它?并且只是文本?
这是来自 table 的代码:
<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>
... //这是link,我想只是原始格式的文本
尝试将 sort = false 分配给您的 dataProvider .. 例如:
$dataProvider['sort'=>false];
这应该禁用排序和使用不需要的 url
请求调用的排序
在 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'],
],
],
]);
in header of table 在网格视图中,正在生成带有一些 url 地址的文本....
/career/index?first_step=pagetitle-60&sort=title
Url 已损坏且不需要,但如何删除它?并且只是文本?
这是来自 table 的代码:
<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>
... //这是link,我想只是原始格式的文本
尝试将 sort = false 分配给您的 dataProvider .. 例如:
$dataProvider['sort'=>false];
这应该禁用排序和使用不需要的 url
请求调用的排序