FUEL CMS User Guide : Version 0.9.3


MY HTML Helper

Contains functions to be used with arrays. Extends CI's array helpers and is autoloaded.

This helper is loaded using the following code:

$this->load->helper('html');

The following functions are available:

tag(open, vals)

Wrap a string or array of values in an opening and closing tag.

$p[0] = 'This is paragraph 1';
$p[1] = 'This is paragraph 2';
$p[2] = 'This is paragraph 3';
echo tag('p', $p);

// echos out
<p>This is paragraph 1</p>
<p>This is paragraph 2</p>
<p>This is paragraph 3</p>

quote(str, [cite], [title], [class_prefix])

Wrap a string into an HTML blockquote with quotes and cite added.

echo quote('Use the force.', 'Obi Wan', 'Jedi', 'quote');

// echos out
	<blockquote class="quote">
		<span class="quote_left">&#8220;</span>Use the force<span class="quote_right">&#8221;</span>
</blockquote> <cite> Obi Wan, <span class="cite_title">Jedi</span> </cite> </div>

html_attrs(attrs)

Creates HTML attributes from an array.

echo $attrs = array('height' => 100, 'width' => 100); // height="100" width="100"