• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set_value with get

#3
I would recommend passing your GET data to the form validation library with the set_data() method (or not using GET with form data). See https://codeigniter.com/user_guide/libra...-than-post

However, I believe the following might be the CI3 equivalent of your function:

PHP Code:
function set_value($field ''$default '')
{
 
   $CI =& get_instance();

 
   $value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field))
 
       $CI->form_validation->set_value($field$default)
 
       $CI->input->post($fieldFALSE);

 
   isset($value) OR $value = ($CI->input->get($field) === null $default $CI->input->get($field));
 
   return ($html_escape) ? html_escape($value) : $value;

Reply


Messages In This Thread
set_value with get - by Hoxfoximper - 04-22-2016, 06:21 AM
RE: set_value with get - by Hoxfoximper - 04-22-2016, 09:40 AM
RE: set_value with get - by mwhitney - 04-27-2016, 07:56 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.