CodeIgniter Forums

Full Version: CI4 - Module not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I try to create new module, i follow this https://codeigniter4.github.io/userguide...dules.html

My module structure is

[Image: ci4.png]

but when i try to access my module with the url: http://devpj.local/blog 
i got the error message 404 - File Not Found
can anyone help me
I got the problem. The CI doesn't scan my Routes.php in acp/blog/config
when i move my Routes code from that folder to app/config/routes.php it work fine

Can anyone help me, how can i make the fw auto load my Routes.php in acp/blog/config???
Hey there,

According to your path, could you please try putting both $psr4 array in Autoload.php
Code:
'Acp'      => ROOTPATH . 'acp',
'Acp\Blog'      => ROOTPATH . 'acp/Blog',
I posted this in the other forum topic but I will also paste it here.

PHP Code:
namespace acp/Blog

$psr4 
= [
    'App'         => APPPATH,                     // To ensure filters, etc still found,
    APP_NAMESPACE => APPPATH,                     // For custom namespace
    'Config'      => APPPATH 'Config',          // Config namespace
    'acp\Blog'    => ROOTPATH.'acp\Blog',         // Acp Blog module
]; 

You need to setup your Config/Autoload.