All Projects → slimphp → Slim

slimphp / Slim

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

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Slim

api rest slim framework
RESTFUL API o API REST con slim framework (PHP, MySql, PDO)
Stars: ✭ 14 (-99.87%)
Mutual labels:  slim, slim-framework
framework
A stylish PHP application framework crafted using Slim, Twig, Eloquent and Sentinel designed to get you from clone to production in a matter of minutes.
Stars: ✭ 56 (-99.5%)
Mutual labels:  slim, php-micro-framework
rawphp
A powerful, robust and API-first, PHP framework that helps people from different PHP backgrounds work on the same project seamlessly. You can write Laravel, CakePHP, Slim, Symphone and Procedural PHP code inside it and it all works perfectly. Its the PHP Framework for everyone.
Stars: ✭ 31 (-99.72%)
Mutual labels:  micro-framework, slim
Meshki
Meshki: A Black-Colored, Responsive Boilerplate for UI Development
Stars: ✭ 129 (-98.85%)
Mutual labels:  framework, micro-framework
Yarf
Yet Another REST Framework
Stars: ✭ 62 (-99.44%)
Mutual labels:  framework, micro-framework
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (-74.75%)
Mutual labels:  framework, micro-framework
Slim-Console
Slim Framework Console
Stars: ✭ 26 (-99.77%)
Mutual labels:  slim, slim-framework
REST-Api-with-Slim-PHP
REST API with PHP Slim Framework 3 and MySQL
Stars: ✭ 69 (-99.38%)
Mutual labels:  slim, slim-framework
Mcp Panthor
A thin PHP microframework built on Slim and Symfony
Stars: ✭ 11 (-99.9%)
Mutual labels:  micro-framework, slim
Framework
MomentPHP | The PHP mini-framework based on Slim and Laravel Components
Stars: ✭ 6 (-99.95%)
Mutual labels:  framework, slim
Chubbyphp Framework
A based PSR-15 microframework that also sets maximum flexibility with minimum complexity and easy replaceability of the individual components, but also of the framework.
Stars: ✭ 69 (-99.38%)
Mutual labels:  framework, micro-framework
Slim3
Slim Framework 3 Skeleton Application
Stars: ✭ 70 (-99.37%)
Mutual labels:  framework, slim
Mini
Just an extremely simple naked PHP application, useful for small projects and quick prototypes. Some might call it a micro framework :)
Stars: ✭ 1,308 (-88.29%)
Mutual labels:  framework, micro-framework
Cyclejs.cn
The Cycle.js Chinese documentation website.
Stars: ✭ 132 (-98.82%)
Mutual labels:  framework
Mix
☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、WorkerMan、FPM、CLI-Server
Stars: ✭ 1,753 (-84.31%)
Mutual labels:  framework
Xnode
Unity Node Editor: Lets you view and edit node graphs inside Unity
Stars: ✭ 2,077 (-81.41%)
Mutual labels:  framework
Dedsploit
Network protocol auditing framework
Stars: ✭ 133 (-98.81%)
Mutual labels:  framework
Parlour
A package of UI extensions, components and improvements for Unity's UI frameworks.
Stars: ✭ 132 (-98.82%)
Mutual labels:  framework
Involt
Inject hardware interactions directly into HTML layout.
Stars: ✭ 128 (-98.85%)
Mutual labels:  framework
Hocus Pocus
Universal and lightweight stylesheet starter kit
Stars: ✭ 128 (-98.85%)
Mutual labels:  framework

Slim Framework

Build Status Coverage Status Total Downloads License

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

Installation

It's recommended that you use Composer to install Slim.

$ composer require slim/slim

This will install Slim and all required dependencies. Slim requires PHP 7.4 or newer.

Choose a PSR-7 Implementation & ServerRequest Creator

Before you can get up and running with Slim you will need to choose a PSR-7 implementation that best fits your application. A few notable ones:

Slim-Http Decorators

Slim-Http is a set of decorators for any PSR-7 implementation that we recommend is used with Slim Framework. To install the Slim-Http library simply run the following command:

composer require slim/http

The ServerRequest and Response object decorators are automatically detected and applied by the internal factories. If you have installed Slim-Http and wish to turn off automatic object decoration then you can use the following statements:

<?php

use Slim\Factory\AppFactory;
use Slim\Factory\ServerRequestCreatorFactory;

AppFactory::setSlimHttpDecoratorsAutomaticDetection(false);
ServerRequestCreatorFactory::setSlimHttpDecoratorsAutomaticDetection(false);

$app = AppFactory::create();

// ...

Hello World using AppFactory with PSR-7 auto-detection

In order for auto-detection to work and enable you to use AppFactory::create() and App::run() without having to manually create a ServerRequest you need to install one of the following implementations:

Then create file public/index.php.

<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;

require __DIR__ . '/../vendor/autoload.php';

// Instantiate App
$app = AppFactory::create();

// Add error middleware
$app->addErrorMiddleware(true, true, true);

// Add routes
$app->get('/', function (Request $request, Response $response) {
    $response->getBody()->write('<a href="https://github.com/hello/world">Try /hello/world</a>');
    return $response;
});

$app->get('/hello/{name}', function (Request $request, Response $response, $args) {
    $name = $args['name'];
    $response->getBody()->write("Hello, $name");
    return $response;
});

$app->run();

You may quickly test this using the built-in PHP server:

$ php -S localhost:8000 -t public

Going to http://localhost:8000/hello/world will now display "Hello, world".

For more information on how to configure your web server, see the Documentation.

Tests

To execute the test suite, you'll need to install all development dependencies.

$ git clone https://github.com/slimphp/Slim
$ composer install
$ composer test

Contributing

Please see CONTRIBUTING for details.

Learn More

Learn more at these links:

Security

If you discover security related issues, please email [email protected] instead of using the issue tracker.

For enterprise

Available as part of the Tidelift Subscription.

The maintainers of Slim and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. Contribute.

Financial Contributors

Become a financial contributor and help us sustain our community. Contribute

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. Contribute

License

The Slim Framework is licensed under the MIT license. See License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].