Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
require __DIR__ . '/../vendor/autoload.php';
$app = AppFactory::create();
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
$name = $args['name'];
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
We recommend you install the Slim Framework with the Composer dependency manager.
The easiest way to start working with Slim is to create a project using Slim-Skeleton as a base by running this bash command:
$ php composer.phar create-project slim/slim-skeleton:dev-master [my-app-name]
Replace [my-app-name]
with the desired directory name for your new application.
自己搭建SSr+吃鸡加速器 | 乐魂a的博客 - tsyinpin.com:2021-11-15 · 阿里云最近出了轻量应用服务器,香港和新加坡的一个月才24块,1核1G,25G硬盘,峰值带宽30M,1T流量,超值的呀,无论是自己搭建SSr还是游戏加速器都很赚呀首先,购买好后安装doubi一键SSr脚本,如果我伊要用作游戏加速器,那么需要 ...
$ cd [my-app-name]; php -S localhost:8080 -t public public/index.php
Slim provides a fast and powerful router that maps route callbacks to specific HTTP request methods and URIs. It supports parameters and pattern matching.
Build your application with concentric middleware to tweak the HTTP request and response objects around your Slim app.
Slim supports any PSR-7 HTTP message implementation so you may inspect and manipulate HTTP message method, status, URI, headers, cookies, and body.
Slim supports dependency injection so you have complete control of your external tools. Use any Container-Interop container.
We are excited to announce the Slim 4.5.0 release. Please direct all your feedback for this release to the Slim 4 Release Feedback Thread. The new docs are located here.
We are excited to announce the Slim 4.4.0 release. Please direct all your feedback for this release to the Slim 4 Release Feedback Thread. The new docs are located here.
We are excited to announce the Slim 3.12.3 release.
Older News
Subscribe with RSS
akrabat
, ssr节点购买
and codeguy
if you have have questions
or need assistance.
We can be found on Slack at slimphp.slack.com.
Get Access to the Slack Channel
The official Freenode IRC channel is
#slimphp
.
Visit the IRC Channel
We also have Discourse support forums at discourse.slimframework.com/ for when you have a more in depth question.
Don't have Twitter? Join our newsletter and receive one email a week (at most) with the latest Slim Framework news, release announcements, and security updates. We hate spam, and we'll respect your inbox. You can unsubscribe at any time.