Hi,
I am new to Slim framework.
I was trying the tutorial for the basic setup. Successfully run a sample project.
While trying to separate the functionality in different classes and trying to load it with composer
setting
"autoload": {
"psr-4": {
"": "src/"
}
}
And finally using it as
$app->get('/route/', \Rain\AppEntry::class . ':home');
I am getting Slim Application Error
as Type: RuntimeException Message: Callable Rain\AppEntry does not exist
The class which is at src/AppEntry.php
looks like
<?php
namespace Rain;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
class AppEntry
{
public function home(Request $request, Response $response, $args)
{
return 'Home from AppEntry';
}
}
The folder structure is as below
public
home.php
src
AppEntry.php
vendor
I am working on a Windows machine with XAMPP.
Any help would be a nice help.
thanks