<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class Parser_form_set_value
{

    public function parse($field, $default  = '', $html_escape  = true)
    {
        if (is_string($html_escape)) {
            $html_escape = strtolower($html_escape) == 'true';
        }

        $ci = get_instance();
        $ci->load->helper('form');

        // If success message was shown empty value
	    if (!empty($ci->load->library('rtform/parser/parser_rtform_message')->get_message())) {
	    	return '';
	    }

        return set_value($field, $default, $html_escape);
    }

}