problem with routes in Code Modules |
hello to everyone according to the instructions in the Code Modules documentation
https://codeigniter4.github.io/userguide...dules.html but for some reason routes do not work in modules here is my code http://prntscr.com/re8f6h http://prntscr.com/re8foi http://prntscr.com/re8fwn http://prntscr.com/re8g2h and when I try to go to the admin panel, I get the following. http://prntscr.com/re8guf
Try this one it works for me, the way you have your group you need to call it like admin/admin
this way you can call it admin and it will go to index method. PHP Code: <?php See the group how I left the first field null '' The bottom one that's remarked out is for the Admin Dashboard which does work using the route->to in html. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-10-2020, 08:10 AM)InsiteFX Wrote: Try this one it works for me, the way you have your group you need to call it like admin/adminit didn’t help, I see so far the very first version of the framework has many shortcomings. I set everything up according to the documentation and it didn’t help that I dropped it, but if I transfer it to the app / Config / routes.php folder, then my first option and yours work there.
The route has to point to the Admin folder for that layout, so:
PHP Code: 'Modules\Admin' => APPPATH .'/Modules/Admin', This quote from that page in the user guide is the crucial bit, here: Quote:When at the acme namespace above, we would need to make one small adjustment to make it so the files could be found: each “module” within the namespace would have to have it’s own namespace defined there. Acme would be changed to Acme\Blog. Once your module folder has been defined, the discover process would look for a Routes file, for example, at /acme/Blog/Config/Routes.php, just as if it was another application. (03-10-2020, 10:28 AM)kilishan Wrote: The route has to point to the Admin folder for that layout, so:ok, the new documentation showed how to write to the autoloader and it was said that it will search in folders, which means that the example is not shown correctly in the documentation.
Sorry if that was misleading. It will search within each namespace for the standard app folders, like Config, Models, etc), but it doesn't handle what you're trying to do here and scan more than one level deep. It will also search within Composer's psr4 namespaces in the same manner.
i got them same problem too, my module folder is: https://s3.upanh.pro/2020/03/10/ci4.png i do as the same document said and my custom routes.php in acp/blog/config can not loaded. when i move the route code to app/config/routes.php i work fine.
how can i auto load the routes.php in acp/blog/config? PHP Code: // namespace acp/Blog What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |