1
votes

I am having a strange problem with my Codeigniter Helper class. I have declared some functions in a helper. I have included the helper in autoload. Its running perfectly in local machine. But when I run it on live server,the helper functions are workng in controller, but in view its giving Fatal error: Call to undefined function strip_tags().

in helper file my_helper.php the function is :

function do_strip($text) {
    $text = strip_tags($text);
    $text = stripcslashes($text);       
    return $text; 
} 

autoload.php :

$autoload['helper'] = array('url','form','my_helper');

in my view I have called :

<?=do_strip($someval)?>

Have missed something or done some mistake ? Can someone please help me on this.

1
use like this $autoload['helper'] = array('url','form','my'); - PravinS
also change the function name as "strip_tags" is PHP function - PravinS
I have changed the function name to do_strip() and gave $autoload['helper'] = array('url','form','my'); . The problem is when I call it in my view file its showing undefined. - noob
Thank you guys. It worked for me!! - noob

1 Answers

1
votes

remove helper text in auto load :

$autoload['helper'] = array('url','form','my');

For more information, refer this Link