04-27-2016, 07:56 AM
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:
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($field, FALSE);
isset($value) OR $value = ($CI->input->get($field) === null ? $default : $CI->input->get($field));
return ($html_escape) ? html_escape($value) : $value;
}