html_helper - some small changes

#1
[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)

Code:
&lt;?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


Messages In This Thread
html_helper - some small changes - by El Forum - 12-18-2008, 03:01 PM
html_helper - some small changes - by El Forum - 12-18-2008, 04:40 PM
html_helper - some small changes - by El Forum - 12-18-2008, 11:10 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.