Module view file showing invalid |
I've added the module folder in ...\app\Config\Autoload.php
Quote:public $psr4 = [ My directory: Quote:/Home directory of main project folder Routes.php PHP Code: namespace Config; Blog.php PHP Code: namespace Blog\Controllers; After running my_domain/index.php/blog, it's showing this error: Quote:CodeIgniter\View\Exceptions\ViewException Where I'm wrong? Looking for help. Thanks in advance.
i have not replicated and tested, but by the looks you should change folders and paths names with capital letters to make exact path matches
/example => /Example public $psr4 = [ APP_NAMESPACE => APPPATH, // For custom app namespace 'Config' => APPPATH . 'Config', 'Blog' => ROOTPATH . 'Example/Blog', ]; $routes->get('blog', 'Blog::index', ['namespace' => 'Blog\Controllers']);
You do not have an `Example` namespace. It is actually `Blog`. So you should use that instead.
PHP Code: function index() { |
Welcome Guest, Not a member yet? Register Sign In |