Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Create new helper in codeigniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 91
    Comment on it

    Helper in codeigniter is not a php class but it is a function which is existing in helper file. Create a file with the name of your helper in /application/helpers here name as myhelper.php and place the following code in that file.

     function yourHelperFunction($var = ''){
           return $var;
       }
    

    Next is to we can use helper either from controller,model or view.

    $this->load->helper('myhelper');
    
    echo yourHelperFunction('my demo helper');
    

    which will provide output my demo helper as a result.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: