Articles → PHP CODEIGNITER → Custom Helper In Codeigniter
Custom Helper In Codeigniter
Purpose
How To Create A Custom Helper?
- Create a file inside the "helper" folder.
- The file name is "test_helper.php". Please note that every custom helper class should be suffixed with "_helper".
- Inside the helper, write the custom function
<?php
function showmessage()
{
echo "Calling showmessage";
}
Calling Custom Helper
$this->load->helper('test');
showmessage();
Output
Click to Enlarge