12-18-2008, 03:01 PM
[eluser]bgougent[/eluser]
Like mentioned in the users guide any type of helper, library etc can be extended.
There are some basic things I was missing in the html_helper:
A <hr /> and a good print_r function.
So I made this small solution (file is called MY_html_helper.php and is placed in the helper folder of the application)
If there are some others adds please provide them. Maybe something for CI 1.7.X
Like mentioned in the users guide any type of helper, library etc can be extended.
There are some basic things I was missing in the html_helper:
A <hr /> and a good print_r function.
So I made this small solution (file is called MY_html_helper.php and is placed in the helper folder of the application)
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
/**
* Generates HTML HR tags based on number supplied
*
* @access public
* @param integer
* @return string
*/
if ( ! function_exists('hr'))
{
function hr($num = 1)
{
return str_repeat("<hr />", $num);
}
}
// ------------------------------------------------------------------------
/**
* Generates PHP print_r with <pre> </pre> tags
*
* @access public
* @param integer
* @return string
*/
if ( ! function_exists('pre'))
{
function pre($array)
{
return '<pre>'. print_r($array, true).'</pre>';
}
}
// ------------------------------------------------------------------------
/* End of file MY_html_helper.php */
/* Location: ./application/helpers/MY_html_helper.php */
If there are some others adds please provide them. Maybe something for CI 1.7.X