Answer the question
In order to leave comments, you need to log in
Load() method not working in yii2?
I'm trying to attach `dosamigos/DatePicker`, but it doesn't work.
I pass get parameters to the search model:
$data_provider = $search_model->search(Yii::$app->request->queryParams);
SearchModel extends ModelName {
//code
public function rules {
return [['created_at'], 'safe'];
}
public function search($params){
//code
$this->load($params);
//code
}
}
Answer the question
In order to leave comments, you need to log in
It turns out that it was necessary to explicitly specify the class name in the input name:
'filter' => DatePicker::widget([
'name' => 'ImagesSearch[created_at]', //было просто 'created_at'
'clientOptions' => [
'format' => 'dd-mm-yyyy'
]
])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question