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

class Parser_rtform_rows
{
    public function parse($form_code)
    {
        $ci = get_instance();
        $ci->load->library('rtform/parser/parser_rtform_row');

        $str = '';
        foreach ($ci->parser_rtform_row->load_library($form_code)->get_rules() as $rule) {
            $str .= $ci->parser_rtform_row->parse($form_code, $rule['field']);
        }

        return $str;
    }
}