Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

<?php
$app = new \Slim\Slim();
$app->get('/hello/:name', function ($name) {
    echo "Hello, $name";
});
$app->run();
Swag! We have some. Shop Now

Features

Router

Slim provides a powerful router that maps route callbacks to specific HTTP request methods and URIs. It supports route segment parameters and pattern matching.

Middleware

Build your application with custom concentric middleware to tweak the HTTP request and response objects before and after your Slim app runs.

HTTP

Slim has easy-to-use request and response abstractions that let you inspect and manipulate HTTP messages' method, status, URI, headers, cookies, and body.

Sessions

Slim provides first-class session support. It persists session data using military grade encryption. Slim also enables "flash" messages across requests.

Caching

Slim provides helper methods that make client-side HTTP caching easier. It helps you work with the Expires, Last-Modified, and ETag headers.

Crypto

Slim has super-secure cryptography using military-grade encryption. Slim uses your unique key to encrypt session and cookie data before persisting data to disk.

Install

We recommend you install the Slim Framework with the Composer dependency manager. Run this bash command in your project's root directory to download and install the latest stable version into your project's vendor/ directory.

composer require slim/slim

Next, require the Composer autoloader into your PHP application.

<?php
require 'vendor/autoload.php';

Latest News

Slim Framework GitHub Organization

The Slim Framework code repositories have a new home in their very own GitHub Organization. As much as I’d like to keep the project beneath my own GitHub handle for the notoriety and what not, the project is best served with its own GitHub Organization. This solves several problems.

What's up with version 3.0?

It’s coming. I promise. As many of you know, I recently finished writing a new book for O’Reilly Media—Modern PHP. I’m excited that my book is nearing publication and should be on bookshelves within a month or two. Unfortunately, writing a book is a time-consuming task. I also have a 9 to 5 day job. Life gets in the way sometimes. Excuses, excuses… I know :) I now have free time to work on Slim again. So what’s going on? A lot.

Older News

Subscribe with RSS

Chat on IRC

The official Freenode IRC channel is #slimphp. You can chat with other Slim Framework developers to share code or troubleshoot tricky issues. My nick is codeguy if you have questions or need assistance in the IRC channel.

Visit the IRC Channel

Read real-time IRC logs on BotBot.me

Follow @slimphp on Twitter