Welcome Guest, Not a member yet? Register   Sign In
create modules in CI 4.3.1
#1

(This post was last modified: 01-18-2023, 06:23 PM by kenjis.)

Hello ,
First thank you to all for this nice working CI framework, really nice.
I have downloaded , installed and working just fine, but I lost on the documentation process of CI , I followed all step but no luck.
i searched , not enough step by step except this post here (https://swww.com.pl/main/index/building-...eigniter-4) worked but still not complete
there is no way to show the view from module view folder.

modules/
    User/
        Config/
        Controllers/  here is my Controller php file pointing to views under acme
        Libraries/
        Models/
        Views/  here is my view php file

when I type my url with user/login,
this part not working, CI doesn't see modules/User/Views/login.php
Code:
public function login(){
      $data = [];
      return  view('Modules\User\Views\login',$data);
    }

but this works

Code:
public function login(){
  
      return  view('welcome_message.php');
    }

Looks CI point to main views folder and not new created views in modules/User folder
any idea how to fix this issue please?

Thank you
Reply
#2

view('Modules\User\Views\login',$data) should work
https://codeigniter.com/user_guide/gener...html#views

if you set the namespace correctly:
https://codeigniter.com/user_guide/gener...namespaces
Reply
#3

(01-18-2023, 06:25 PM)kenjis Wrote: view('Modules\User\Views\login',$data) should work
https://codeigniter.com/user_guide/gener...html#views

if you set the namespace correctly:
https://codeigniter.com/user_guide/gener...namespaces

thank you that worked
Reply




Theme © iAndrew 2016 - Forum software by © MyBB