Hi, i am new to slim framework 3.
just follow the instruction “hello world” … i try to write my code.
i put index.php, routes.php and .htaccess … in one folder
the problem is :
if i write my route in index.php … everything is running well.
but if i put my route in file “routes.php” … my browser just blank.
any suggestion ?
======
index.php
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
$app = new \Slim\App();
require 'routes.php';
$app->run();
?>
=========
and route.php
<?php
$app->get('/', function (Request $request, Response $response)
{
$response->getBody()->write("Hello, friend");
return $response;
});
?>
========
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]