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 checkKey
Like Widox said, I think a Helper is the best way out. Something like this:
db->query("SELECT $keyFROM $table WHERE id = $userid LIMIT 1");
if($query->num_rows() > 0)
{
return true;
}else
{
return false;
}
}
?>
Then you can freely use on your views, just loading in your respective controllers like: $this->load->helper('test');.