Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

How can I get the filenames as well as functions

$
0
0
I have some data on my controller for my permissions controller


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;
    }
            


Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>