Simple Example
Neeeded 3 files
- file to program(eg- index.php/myfile.php)
- Slim(downloaded package)
- .htaccess
Step 1: .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
Step 2: myfile.php
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app=new \Slim\Slim();
$app->get('/',function() {
echo "Hello World";
});
$app->run();
Running Program
localhost/project1/myfile.php
More tutorials
http://nesbot.com/2012/6/26/multilingual-site-using-slim
https://github.com/briannesbitt/Slim-ContextSensitiveLoginLogout