Reputation: 4305
Hi I have a doubt about how to call a function which is defined in normal core php file. Now i want to call this function in controller of Codeigniter application.
What i mean is for example there is a function named with getdetails() in test.php in some directory. Now there is a codeIgniter application which has controller email.php.
Now i want to call getdetails() function in email.php.
Can anyone help me with some ideas.
Upvotes: 1
Views: 2105
Reputation: 1167
Build your own helper, save this as test_helper.php in your application helpers folder:
function getdetails($paramater1, $parameter2){
echo "test";
}
Then load it within your controller:
$this->load->helper('test');
And you can use it as this everywhere it's loaded:
getdetails();
Upvotes: 4
Reputation: 1987
You merely need to include the file before attempting to call the function. include or include_once
Upvotes: -2