Welcome Guest, Not a member yet? Register   Sign In
Controller or its method is not found: \App\Controllers\Tasks::index
(This post was last modified: 07-11-2022, 08:27 AM by Ahmed Haroon.)

simply unzipped CodeIgniter ver 4.1.9 in d:\xampp\htdocs folder and rename it to taskapp.
in .env file :

CI_ENVIRONMENT = development
app.baseURL = 'http://localhost:8088/taskapp/public'

in Routes.php i set :

in browser i can run successfully: http://localhost:8088/taskapp/public
created a folder in Views and a file under this folder index.php
in Controllers modified Home.php to return that view file successfully.
return view('Home/index');

all 3 url's are working fine, showing the same page:

copied that Home.php in Controllers and rename it to Tasks.php which contents are as below:

PHP Code:

namespace App\Controllers;

Tasks extends BaseController
    public function index()
        return view('Tasks/index');

created a folder in Views named Tasks and under this folder created a file index.php which contents i copied from index.php as below:

PHP Code:
<!DOCTYPE html>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="">
        <h2>Welcome Tasks!</h2>

in browser trying to access below but it shows error:

404 - File Not Found
Controller or its method is not found: \App\Controllers\Tasks::index

what i missed or doing wrong here? please guide
Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.  
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed. 

Messages In This Thread
Controller or its method is not found: \App\Controllers\Tasks::index - by Ahmed Haroon - 07-11-2022, 07:05 AM

Theme © iAndrew 2016 - Forum software by © MyBB