CodeIgniter - Calling a function from inside a view

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-12-05T03:36:00Z Indexed on 2011/02/20 15:24 UTC
Read the original article Hit count: 156

Filed under:

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

© Stack Overflow or respective owner

Related posts about codeigniter