File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 37
37
* 'ERememberFiltersBehavior' => array(
38
38
* 'class' => 'application.components.ERememberFiltersBehavior',
39
39
* 'defaults'=>array(),
40
- * 'defaultStickOnClear'=>false
40
+ * 'defaultStickOnClear'=>false,
41
+ * 'scenarioName'=>'search',
41
42
* ),
42
43
* );
43
44
* }
59
60
* $model=new Persons('search');
60
61
* $model->setRememberScenario('scene1');
61
62
*
63
+ * 'scenarioName'=>'search' is a name of a search function in your model. Change this, if you use other function name,
64
+ * i.e. if your code looks like:
65
+ *
66
+ * $model=new Persons('searchSort'));
67
+ *
62
68
*
63
69
* CHANGELOG
64
70
*
@@ -101,6 +107,13 @@ class ERememberFiltersBehavior extends CActiveRecordBehavior {
101
107
* @var boolean
102
108
*/
103
109
public $ defaultStickOnClear =false ;
110
+ /**
111
+ * Default search scenario name
112
+ *
113
+ * @var string
114
+ */
115
+ public $ scenarioName ='search ' ;
116
+
104
117
/**
105
118
* Holds a custom stateId key
106
119
*
@@ -171,7 +184,7 @@ private function saveSearchValues() {
171
184
172
185
173
186
private function doReadSave () {
174
- if ($ this ->owner ->scenario == ' search ' || $ this ->owner ->scenario == $ this ->rememberScenario ) {
187
+ if ($ this ->owner ->scenario == $ this -> scenarioName || $ this ->owner ->scenario == $ this ->rememberScenario ) {
175
188
$ this ->owner ->unsetAttributes ();
176
189
177
190
// store also sorting order
You can’t perform that action at this time.
0 commit comments