I have some data on my controller for my permissions controller
It prints out
How every I would like it to be able to also get the functions that are inside controllers as well.
So I can do this below with 3 pramater How can I get the files but as well as functions.
PHP Code:
$data['permissions'] = array();
$files = glob(APPPATH . 'controllers/*/*.php');
$ignore = array(
'common/login'
'common/Dashboard',
);
foreach ($files as $file) {
$part = explode('/', dirname($file));
$permission = end($part) . '/' . basename($file, '.php');
if (!in_array($permission, $ignore)) {
$data['permissions'][] = $permission;
}
}
It prints out
Code:
array(4) {
[0]=>
string(14) "common/Welcome"
[1]=>
string(19) "security/Permission"
}How every I would like it to be able to also get the functions that are inside controllers as well.
So I can do this below with 3 pramater How can I get the files but as well as functions.
PHP Code:
$ignore = array(
'common/Login'
'security/Permission/edit',
);
foreach ($files as $file) {
$part = explode('/', dirname($file));
$permission = end($part) . '/' . basename($file, '.php');
if (!in_array($permission, $ignore)) {
$data['permissions'][] = $permission;
}
}