The HTML helper file contains functions that assist in working with HTML.
siteURL
Return site URL with the index page.
// If no index.php file is specified in configuration file, it won't be included
html_helper::siteURL(); // http://www.example.com/index.php
html_helper::siteURL('users'); // http://www.example.com/index.php/users
html_helper::siteURL('users', 'https'); // https://www.example.com/index.php/users
baseURL
Return site URL without the index page.
html_helper::baseURL(); // http://www.example.com/
html_helper::baseURL('externals/javascript.js'); // http://www.example.com/externals/javascript.js
indexPage
Return index.php if it exists in the configuration or blank otherwise.
html_helper::indexPage();
currentPage
Return current page URL.
html_helper::currentPage();
anchor
Create anchor link.
html_helper::anchor('users', 'Users'); // <a href="http://www.example.com/index.php/users">Users</a>
html_helper::anchor('users', 'Users', 'Users title'); // <a href="http://www.example.com/index.php/users" title="Users title">Users</a>
html_helper::anchor('users', 'Users', '', array('style' => 'color:red')); // <a href="http://www.example.com/index.php/users" style="color:red">Users</a>
html_helper::anchor('users', 'Users', '', array(), 'https'); // <a href="https://www.example.com/index.php/users">Users</a>
mailto
Create email anchor link.
html_helper::anchor('email@site.com', 'Email us'); // <a href="mailto:email@site.com">Email us</a>
html_helper::anchor('email@site.com', 'Email us', 'Contact us'); // <a href="mailto:email@site.com" title="Contact us">Email us</a>
html_helper::anchor('email@site.com', 'Email us', '', array('style' => 'color:red')); // <a href="mailto:email@site.com" style="color:red">Email us</a>
image
Create image element.
html_helper::image('logo.gif', array('border' => 0)); // <img src="http://www.example.com/logo.gif" border=0 />
style
Create style sheet link.
html_helper::style('style.css'); // <link href="http://www.example.com/style.css" rel="stylesheet" type="text/css" />
script
Create javascript script link.
html_helper::script('javascript.js'); // <script src="http://www.example.com/javascript.js" type="text/javascript"></script>