Set value doesn,t return the value CI 2.0 - 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: Set value doesn,t return the value CI 2.0 (/showthread.php?tid=39955) |
Set value doesn,t return the value CI 2.0 - El Forum - 03-25-2011 [eluser]JuanitoDelCielo[/eluser] I have one form to search Code: <?php echo form_open($search); ?> And it works, and using the profiler I know the value POST DATA $_POST['q'] Search String So the input field should have the search String but it always show Search Any ideas? Set value doesn,t return the value CI 2.0 - El Forum - 03-25-2011 [eluser]InsiteFX[/eluser] Thats because you have to post to controller/method! Code: echo form_open('email/send'); InsiteFX Set value doesn,t return the value CI 2.0 - El Forum - 03-25-2011 [eluser]JuanitoDelCielo[/eluser] This is the value of $search Code: $data->search = 'classified/index'; Set value doesn,t return the value CI 2.0 - El Forum - 03-25-2011 [eluser]bEz[/eluser] Are you sending $data as an object instead of as an array? Code: $data['search'] = 'classified/index'; Set value doesn,t return the value CI 2.0 - El Forum - 03-25-2011 [eluser]JuanitoDelCielo[/eluser] Yes but its the same. If you read the Loader.php code you will find this: Code: function view($view, $vars = array(), $return = FALSE) get_object_vars Set value doesn,t return the value CI 2.0 - El Forum - 03-28-2011 [eluser]JuanitoDelCielo[/eluser] It was really easy. Just add a simple rule to via the form validataion class. |