forked from slimphp/Slim
-
Notifications
You must be signed in to change notification settings - Fork 0
A RESTful micro framework for PHP inspired by Sinatra
kolanos/Slim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Slim
Welcome to Slim! Slim is a micro-framework for PHP 5 inspired by the Sinatra framework for Ruby. Slim includes the following features:
- Compatible with PHP 5 (PHP 5 >= 5.3 recommended)
- Clean and simple PHP syntax
- RESTful routing (GET, POST, PUT, and DELETE)
- Before and after callbacks
- Easy-to-extend templating (use Smarty, Twig, or whatever you want)
- Halt with custom status code and message
- Easily modify the HTTP request and response
Here is a Hello World application written with Slim:
<?php
//Require Slim
require('slim/Slim.php');
//Initialize Slim
Slim::init();
//Define routes (PHP 5 >= 5.3)
Slim::get('/hello/:name', function ($name) {
echo "Hello! Your name is $name and you are using PHP 5.3";
});
//Define routes (PHP 5 < 5.3)
Slim::get('/hello/:name', 'example_hello');
function example_hello($name) {
echo "Hello! Your name is $name and you are not using PHP 5.3";
}
//Run Slim
Slim::run();
?>
Slim is created and maintained by Josh Lockhart (@codeguy on Twitter). Slim is still in active development and has not been fully tested. Use at your own risk, but feel free to kick the tires and take it for a spin!
Slim is released under the MIT public license.
Thanks!
Josh Lockhart
---
Documentation: http://slim.joshlockhart.com/
Source Code: http://github.com/codeguy/Slim/
Twitter: http://www.twitter.com/codeguy
LinkedIn: http://www.linkedin.com/in/joshlockhart
Email: info@joshlockhart.comAbout
A RESTful micro framework for PHP inspired by Sinatra
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published