A Controller is simply a class file that handles all http request.It is a part of MVC architecture
inside the folder app/Controllers/TestController.php and place the code below
<?php
namespace App\Controllers;
use CodeIgniter\Controller;
class TestController extends Controller
{
public function index()
{
echo 'Hello World!';
}
}
Make sure the class name and the file name should match.