CodeIgniter Forums

Full Version: Access controller located in “folder_name/controller_name” in code-igniter 4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i access my controller located in “folder_name/controller_name” in codeigniter 4?

Quote:My Master controller located in "admin" folder. View image 
[Image: VRtLl.png]

namespace App\Controllers\admin;
use CodeIgniter\Controller;
class Master extends Controller
function __construct(){
public function index()
echo view('template/template', $data);

Quote:In my Routes.php i added this


Quote:when i access the page in the browser i get this error

404 - File Not Found Controller or its method is not found: {0}::{1}
What am i missing?
Your namespace must match the folder structure. This post should help clear it up, I think.