Over a million developers have joined DZone.

Using Module_parse Like Module_view In Code Igniter Using Matchbox

·
// Updating Matchbox for use Parser as the same easy way to use module_view
//
// I only made a extension as copy paste from original parse method


load->module_view($module, $template, $data, TRUE);
		
		if ($template == '')
		{
			return FALSE;
		}
		
		foreach ($data as $key => $val)
		{
			if (is_array($val))
			{
				$template = $this->_parse_pair($key, $val, $template);		
			}
			else
			{
				$template = $this->_parse_single($key, (string)$val, $template);
			}
		}
		
		if ($return == FALSE)
		{
			$CI->output->append_output($template);
		}
		
		return $template;
	}
}
// END Parser Class

/* End of file MY_Parser.php */
/* Location: ./system/libraries/application/MY_Parser.php */

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}