Custom Helper
Create Controller

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Controller {

public function index()
{
$this->load->helper('new_helper');
echo test_method('Hello World');
}

}

Create Helper

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('test_method'))
{
function test_method($var = '')
{
return $var;
}
}


Previous
Next