session_start();
date_default_timezone_set(\'GMT\');
require \'Slim/Slim.php\';
use Slim\\Slim;
\\Slim\\Slim::registerAutoloader();
$app = new \\Slim\\Slim();
requ
You can use this code for Slim Framework3:
<?php
require "vendor/autoload.php";
use \Slim\App;
$app = new App();
$app->get("/",function(){
echo "Hello World";
});
$app->get("/test",function(){
echo "Hello World";
});
$app->run();
?>
The Slim
class' full name (including namespace) is \Slim\Slim
so you'll need to use that, eg
$app = \Slim\Slim::getInstance();
Alternatively, you can import the Slim
symbol using the use
statement at the top of your item.php
script.
use Slim\Slim;