CodeIgniter - Calling a function from inside a view
- by Chris
Hey,
Is it possible to call a function which is located in a controller from a view.
This is what i have in my controller, as an example
function checkKeyExists($userid, $key){
}
Then inside my view i have the following
if(checkKeyExists($row->id, $role->key)){
}
But when i run it, it says that checkKeyExists is not defined.
If anyone can let me know how i could do this, that would be great.
Cheers