• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI4 - Module not working

#1
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
Reply

#2
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???
Reply

#3
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',
Reply

#4
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.