This is an extension that can be used to easily save and load default values of any model. I use it e.g. to save current settings of a filter model to session. Later when a backend user comes back to the page, the same filter settings will be provided for convenience.
Check out the extension page for more details and a full usage example:
http://www.yiiframew...faultpersister/
Questions and suggestions are welcome.
Page 1 of 1
[EXTENSION] defaultpersister Save/load attribute values as default to session
#2
Posted 11 January 2011 - 03:47 PM
Updated to 1.1.0:
The extension now also allows to load ActiveRecord attributes that where defined in the model file only.
resetDefaults() can be used to reset (clear) attributes. If no argument is supplied, all values will be cleared. It can also be called with a single attribute name or an array of names that should be cleared.
The extension now also allows to load ActiveRecord attributes that where defined in the model file only.
resetDefaults() can be used to reset (clear) attributes. If no argument is supplied, all values will be cleared. It can also be called with a single attribute name or an array of names that should be cleared.
#3
Posted 11 January 2011 - 04:35 PM
Big congratulations Mike, it is a very useful, very good extension.
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#4
Posted 12 January 2011 - 03:30 AM
Thanks, Antonio.
In fact i really got used to this little helper. For example it's useful if you want to create wizard like forms over multiple pages: I create scenarios for each page and if a page validates i use saveAsDefaults() to remember the form inputs. Only after the last page i call save() to finally store the data to DB. Works like a charm
In fact i really got used to this little helper. For example it's useful if you want to create wizard like forms over multiple pages: I create scenarios for each page and if a page validates i use saveAsDefaults() to remember the form inputs. Only after the last page i call save() to finally store the data to DB. Works like a charm
#5
Posted 12 January 2011 - 04:34 AM
Mike, on 12 January 2011 - 03:30 AM, said:
In fact i really got used to this little helper. For example it's useful if you want to create wizard like forms over multiple pages: I create scenarios for each page and if a page validates i use saveAsDefaults() to remember the form inputs. Only after the last page i call save() to finally store the data to DB. Works like a charm 
Impressive...
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
Share this topic:
Page 1 of 1

Help













