Is it possible to have subforder in Controlllers directory |
I am starting a project and wanted to put all admin controler in a sub directory admin. I try it but
I receveive a message the Controller or its method is not found: App\Controllers\Admin::categ I don't want to put all sources in only the same controller directory
You need to reference it as App\Controllers\Admin\Admin, as it's an Admin controller inside an Admin folder.
PHP Code: namespace App\Controllers\Admin; (04-06-2020, 08:57 AM)jreklund Wrote: You need to reference it as App\Controllers\Admin\Admin, as it's an Admin controller inside an Admin folder. Thank you. I think something is still missing Class 'App\Controllers\Admin\BaseController' not found APPPATH/Controllers/Admin/Acticateg.php at line 2 Code: 1 <?php namespace App\Controllers\Admin;
BaseController are in the \App\Controllers\BaseController and needs to have it's full reference or you need to specify use.
PHP Code: <?php namespace App\Controllers\Admin; PHP Code: <?php namespace App\Controllers\Admin;
I've got a couple of free articles about namespaces that will help clarify things for you, I think:
Primar: Namespaces and CI4 Going Deeper with Namespaces |
Welcome Guest, Not a member yet? Register Sign In |