Codeigniter gives the facility to create own helper according to requirement. You can code easily and call inside the codeigniter controller or model.
1) Create a file and put the following code into it.
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('test_method'))
{
function test_method($var = '')
{
return $var;
}
}
Save this to application/helpers/ "new_helper.php"
2) Using the Helper
First use the code as bellow to load the helper file.
$this->load->helper('new_helper');
3) Calling of method.
echo $this->test_method('Hello World');
0 Comment(s)