restlin/grid-to-session-behavior
Composer 安装命令:
composer require restlin/grid-to-session-behavior
包简介
This is yii2 controller behavior. It can save and restore grid filters, page and sort in session.
README 文档
README
This is yii2 controller behavior. It can save grid filters, page and sort in session and restore when user return to action with grid.
example for using this behavior in controller:
/** * Lists all Document models. * @param integer $mode in this case this parameter is indicator for restore params from session * @return mixed */ public function actionIndex($mode=null) { $searchModel = new DocumentSearch(); if(!$mode) { $this->loadParams(); $mode = Yii::$app->request->get('mode'); } $this->saveParams('DocumentSearch',['mode'=>1]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2016-09-27