Validation - Can someone explain this code? - 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: Validation - Can someone explain this code? (/showthread.php?tid=12080) |
Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]The Wizard[/eluser] Hello friends, ive modified my code a little according to the validation tutorial series (7 screencasts) and now i have a question about a particular part in the code. Code: function setinfo () and for the view part, when setting or better say, re populating forms, we tend to use things like: Code: <?= form_input( 'name', $this->validation->name ) ?> in this modified code i use: Code: <?= form_input( 'name', $values['name'] ) ?> but as you may have noticed, i didnt use the first one in a fashion like $this->validation->name to re-populate it. So how come, this code actually works? I would be more then happy if i can understand how this works. Thanks in advance Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]Yash[/eluser] xwero tells in some post there are three ways to call same thing two way you already shown... third..lemme search or xwero will help Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]The Wizard[/eluser] would be cool besides, i looked at blogmer, looks very very promising, cool man Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]Yash[/eluser] $_POST['some_field'] third one.. Thanks Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]manilodisan[/eluser] This is how they get assigned inside the validation library: Code: foreach ( $_POST as $key => $value ) '$this->validation->name' is already assigned when you call it in your form. Validation - Can someone explain this code? - El Forum - 10-05-2008 [eluser]The Wizard[/eluser] hmmmmmmmmmmmmmmmmm i see... thanks manilodisan |