Slim: A PHP5 Sinatra Clone

Screen shot

Frank Sinatra was the Chairman of cool. Some fourteen years after his death, the crooner is still imitated.

Just like its namesake, Sinatra, the class Ruby web application DSL still inspires all sorts of projects from Sammy.js to Padrino to Denied.

Slim, a PHP5 project from Josh Lockhart is the latest project to cover the classics.


To get started, just require the script and call init



Slim supports the familiar Sinatra-style routes for all four HTTP verbs:

Slim::get('/books/:id', function ($id) {
    //Do something

Slim::post('/books', function () {
    //Do something

Slim::put('/books/:id', function ($id) {
    //Do something

Slim::delete('/books/:id', function ($id) {
    //Do something

Middleware and callbacks

Slim also allows you to run code before and after your actions:

Slim::before(function () {
    //Do something

Slim::after(function () {
    //Do something


Slim supports a variety of templates including Smarty and Twig.

[Source on GitHub] [Hompage]

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

Beyond Code: Season 3 / GopherCon 2015

0:00 / 0:00