I want to use Slim 3 in a subdirectory, but cannot seem to load it. All files are contained in the subdirectory, including composer.json. Here is my composer.json:
"require": {
"slim/slim": "3.0.0-RC1"
}
Here is my script:
<?php
require "vendor/autoload.php";
use \Slim\Slim;
$app = new \Slim\Slim();
$app->get('/subdirectory/hello/:name', function ($name) {
echo "Hello, $name";
});
$app->run();
I tried many things, including Class Slim not found when installing slim with composer and PHP Fatal error: Class 'Slim' not found. Unfortunately, they didn't solve my problem.
The error I get is Fatal error: Class 'Slim\Slim' not found in ... on line 5
, which corresponds to $app = new \Slim\Slim();
.
Anyone know what I'm missing?