Articles → PHP CODEIGNITER → Custom Helper In Codeigniter

Custom Helper In Codeigniter






Purpose





How To Create A Custom Helper?




  1. Create a file inside the "helper" folder.
  2. The file name is "test_helper.php". Please note that every custom helper class should be suffixed with "_helper".
  3. Inside the helper, write the custom function
<?php

function showmessage()
{
echo "Calling showmessage";
}



Calling Custom Helper




$this->load->helper('test');
showmessage();





Output


Picture showing output of custom helper in codeigniter
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, July 22, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250