New function for Datamapper - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: New function for Datamapper (/showthread.php?tid=14845) |
New function for Datamapper - El Forum - 01-17-2009 [eluser]Iverson[/eluser] I'm sure I'm not the only one who has tables like "Countries" or "States" that I need to edit or choose from. So I wrote a function to stick in the Datamapper library that will return a select menu populated from the db. It will even select a value given the id of the row. This will be useful when editing someone's record. If the Model you specify doesn't exist, it will not throw an error, but simply return FALSE; Use: Code: $array = array( Code: // -------------------------------------------------------------------- |