CodeIgniter - How to get a list of all my controllers dynamically?

前端 未结 2 469
再見小時候
再見小時候 2021-01-15 15:48

I need to run a function to do some actions with each controller-name on my project. My function is defined on a controller like this:



        
2条回答
  •  逝去的感伤
    2021-01-15 16:26

    foreach(glob(APPPATH . 'controllers/*' . 'php') as $controller){
       $controller = basename($controller, '.php');
    }
    

提交回复
热议问题