![]() |
Resetting class variables to defaults - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Resetting class variables to defaults (/showthread.php?tid=12489) |
Resetting class variables to defaults - El Forum - 10-21-2008 [eluser]Daniel H[/eluser] I start my models with.. Code: <?php ... and then I have a reset() function that looks like this... Code: function reset() Instead of listing out all the variables again with their defaults, is there a shorthand which just sets the variables back to their original values? Many thanks, Dan. Resetting class variables to defaults - El Forum - 10-21-2008 [eluser]xwero[/eluser] try playing around with get_class_vars Resetting class variables to defaults - El Forum - 10-21-2008 [eluser]Daniel H[/eluser] Perfect - thanks a lot. |