Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB