2016-04-29 110 views
-1

我想爲'filterModel'配置表單文本。這是我的代碼。yii2 gridview:如何爲filterModel配置css

GridView::widget([ 
    'dataProvider' => $dataProvider, 
    'filterModel' => $searchModel, 
    'columns' => $gridColumns, 
]) 
+1

只是一個友情提示,您可能需要閱讀過此頁:[該如何對詢問指南(https://stackoverflow.com/help/how-to-ask),所以你始終可以確保您的問題很容易回答並且儘可能清晰。一定要包括你爲解決你遇到的問題所做的任何努力,以及當你嘗試修復這些問題時發生了什麼。另外不要忘記你的顯示代碼和任何錯誤信息! –

+0

「config」是什麼意思? –

回答

0

以下是GridzView for filterModel的一些選項。 GridView api

/** 
* @var array the HTML attributes for the filter row element. 
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. 
*/ 
public $filterRowOptions = ['class' => 'filters']; 
/** 
* @var array the options for rendering the filter error summary. 
* Please refer to [[Html::errorSummary()]] for more details about how to specify the options. 
* @see renderErrors() 
*/ 
public $filterErrorSummaryOptions = ['class' => 'error-summary']; 
/** 
* @var array the options for rendering every filter error message. 
* This is mainly used by [[Html::error()]] when rendering an error message next to every filter input field. 
*/ 
public $filterErrorOptions = ['class' => 'help-block'];