Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FilterCol extends Model
- {
- private $data=array();
- public function __get($name)
- {
- if (array_key_exists($name, $this->data)) {
- return $this->data[$name];
- }
- }
- public function rules() {
- return [
- /* your other rules */
- [['nameGroup'],'default']
- ];
- }
- public function search($params) {
- print_r($params);
- }
- }
- $searchModel=new FilterCol();
- $searchModel->search(Yii::$app->request->queryParams);
- or
- 'filterModel'=>true,
- 'columns' => [
- [
- 'label' =>"г",
- 'attribute' => 'nameGroup',
- 'format'=>'raw',
- 'filter' =>'<input class="form-control" name="filter[nameGroup]" value="'.Yii::$app->request->get('filter')['nameGroup'].'" type="text">'
- ,
- ],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement