![]() |
Validation Class [SOLVED] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Validation Class [SOLVED] (/showthread.php?tid=10604) |
Validation Class [SOLVED] - El Forum - 08-06-2008 [eluser]Matthew Lanham[/eluser] Hey guys, I wanted some advice re the validation class... We have a CRUD setup, and it works great for the create, but update seems to be a bit of an issue, i want to use the same view for the update when its first viewed and after the post, in the create view i have: <?php echo $this->validation->price_rrp;?> in the value element of the input fields but if i do this in the update section, how can i get the initial data in those elements, i need some way of setting the data initially Do i make sense???? Validation Class [SOLVED] - El Forum - 08-06-2008 [eluser]Matthew Lanham[/eluser] Ok so i figured this one out, i done some digging in the validation class and noticed it used $_POST to find items and set data etc. So basically in my controller i have: Code: //Set validation data from the Model In my model Product i have the array of rules, fields and i have created the find function and it has a switch for the data returned, array will return an array blank will return an object... Hope this helps someone |