CodeIgniter is a fairly well equipped framework, and it's easy to let some of its functions slip away from you. This section is dedicated to bringing your attention to some of its lesser-known but also awesome functions, such as:
$this->load->helper('html');
CodeIgniter comes with a function that lets you easily add doctypes to your view files. This is stored in the HTML helper. It will default to XHTML 1.1 Strict, and supports HTML4 and 5 doctypes.
Here's an example of some of the doctypes that you can display by using this function.
doctype('html5'); // HTML5 doctype('xhtml11'); // XHTML 1.1 doctype('xhtml1-strict'); // XHTML 1.0 Strict doctype('xhtml1-trans'); // XHTML 1.0 Transitional doctype('xhtml1-frame'); // XHTML 1.0 Frameset doctype('html4-strict'); // HTML 4 Strict doctype('html4-trans'); // HTML 4 Transitional doctype('html4-frame'); // HTML 4 Frameset
This is very useful because you won't need to find a doctype to copy and paste in from somewhere...