Welcome Guest, Not a member yet? Register   Sign In
Helpers
#1

[eluser]Unknown[/eluser]
Hi, can anyone tell me much on how to create my own helper under the application/helpers directory of my application. I'm stack on how i use them.An example will be much better
#2

[eluser]Aken[/eluser]
1) Create a file in the application/helpers folder using the name scheme yourfile_helper.php, where "yourfile" can be any lowercase word you would like to call the helper functions with (CI examples: url, date, language).

2) Add your procedural helper functions to the file. Open up a CI helper file if you need a reference.

3) Load your helper functions using $this->load->helper('yourfile');
#3

[eluser]InsiteFX[/eluser]
CodeIgniter helper template.
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Name Helper
*
* @package        CodeIgniter
* @subpackage    Helpers
* @category    Helpers
* @author        Raymond King aka:(InsiteFX).
* @copyright    Copyright (c) 2005 - 2011, Advanced Computer Systems, LLC.
* @license        http://www.learnellislab.com/codeigniter/user-guide/license.html
* @link        http://www.learnellislab.com/codeigniter/user-guide/helpers/name_helper.html
* @since        Version 1.0.0
*/

// ------------------------------------------------------------------------

/**
* Name
*
* Description:
*
*
* @access    public
* @param    string
* @param    array
* @param    mixed
* @return    mixed
*/
if ( ! function_exists('name'))
{
    function name()
    {

    }
}

// ------------------------------------------------------------------------
/* End of file name_helper.php */
/* Location: ./application/helpers/name_helper.php */

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB