我正在使用以下代码,该代码是在创建CRUD操作时由Gii工具生成的
<?php Pjax::begin(); ?> <?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'text:ntext',
'status',
'name',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php Pjax::end(); ?>
答案 0 :(得分:1)
您可以使用layout:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'layout' => "{items}\n{pager}",
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'text:ntext',
'status',
'name',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
答案 1 :(得分:0)
添加“摘要”键并将其传递为空白。
<?php Pjax::begin(); ?> <?= GridView::widget([
'dataProvider' => $dataProvider,
'summary'=>'',
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'text:ntext',
'status',
'name',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php Pjax::end(); ?>