[eluser]zsela[/eluser]
Hello all!
I would like to ask your help regarding my problem: created a helper (common_functions_helper) with a function in it:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function entitle ($action) {
$entitled = 0;
$rights = $this->session->userdata('rights');
for ($i = 0; $i < count($rights); $i++){
if ($rights[$i] == $action) $entitled = 1;
}
return $entitled;
}
?>
I tried to you this entitle function in one of my controllers, but it ruins the whole caller function. I loaded the helper in the constructor:
Code:
$this->load->helper('common_functions');
Then, I tried to use the function this way:
Code:
if ($this->entitle(1005)) {
do some stuff here...
}
The result is a blank page. The strange thing is when I copy the function into the controller and remove the load for the helper it works perfectly fine.
I think I used the helper correctly according to CI user guide.
Please give me some suggestions, what can be the problem? Thanks in advance!