Reputation: 23
I want to append a parameter to the auto generated parameters of filtermodel
in GridView
How do I add additional parameters?
Upvotes: 2
Views: 1295
Reputation: 1417
You can use 'filterUrl' property of GridView
In your GridView
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'filterUrl' => ['YOUR_CONTROLLER_ACTIONID_HERE','date' => date('Y-m-d')],
'columns' => [
],
]); ?>
first parameter to 'filterUrl' is your action id. After that you can give your additional url parameters as key value pair
Upvotes: 3