Hello im new in slim,
i have some problem while creating a controller, here’s my code
my directory
config
– routes.php
public
src
– Action
— AppAction.php
routes.php
<?php
use App\Action\AppAction;
// Routes Here
$app->get('/', AppAction::class . ':index');
AppAction.php
<?php
namespace App\Action\AppAction;
class AppAction {
public function index(){
$response->getBody()->write("Hello world");
return $response;
}
}
composer.json
"autoload": {
"psr-4": {
"App\\": "src/"
}
}
I Got This error
Uncaught RuntimeException: Callable App\Action\AppAction does not exist
all this code gives me a headache, I will be very grateful to anyone who helps me, thank you