1
在視圖中,添加buttons
會創建錯誤頁面。如何取出Update
按鈕?從GridView刪除更新按鈕?
這是我的觀點:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'user.username',
'title',
'img_title',
'note_type',
['class' => 'yii\grid\ActionColumn'],
// I do not want the Update button.
// Adding this 'button' creates a error.
// 'buttons' => ['{view},{delete}']
],
]); ?>
添加 '按鈕'
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: yii\grid\DataColumn::0