Saturday, 15 March 2014

php - Codeigniter Glob Path -



php - Codeigniter Glob Path -

i making function in codeigniter glob apppath got couple of bugs unsure of.

on permissions trying ignore controllers set in ignore array still shows them up. , says controllers/header should header

$ignore = array( 'footer', 'header' ); $data['permissions'] = array(); $files = glob(apppath . 'controllers/*.php'); foreach ($files $file) { $part = explode('/', dirname($file)); $permission = end($part) . '/' . basename($file, '.php'); if (!in_array($permission, $ignore)) { $data['permissions'][] = $permission; } } if (!empty($this->input->get_post('permission','access'))) { $data['access'] = $this->input->get_post('permission','access'); } elseif (!empty($user_group_info['permission']['access'])) { $data['access'] = $user_group_info['permission']['access']; } else { $data['access'] = array(); }

i think should use

$permission = basename($file, '.php');

in place of $permission = end($part) . '/' . basename($file, '.php');

php codeigniter

No comments:

Post a Comment