afief/slim 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

afief/slim

Composer 安装命令:

composer require afief/slim

包简介

This is a form repo of slim framework from slim/slim with some update like middleware arguments, return object response into a json string, etc. Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

README 文档

README

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 "^3.0"

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

Usage

Create an index.php file with the following contents:

<?php

require 'vendor/autoload.php';

$app = new Slim\App();

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

$app->run();

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

$ php -S localhost:8000

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.

Additional Features

  • Return an object from controller into json string
  • Additional arguments for middleware
$mw = function ($request, $response, $next, $arg1, $arg2) {
    $response->getBody()->write($arg1);
    $response = $next($request, $response);
    $response->getBody()->write($arg2);

    return $response;
};

$app->get('/hello/{name}', function ($request, $response, $args) {
    $response->write("Hello, " . $args['name']);
    return $response;
})->add($mw, ['first_argument', 'second_argument']);

Tests

To execute the test suite, you'll need phpunit.

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Learn More

Learn more at these links:

Security

If you discover security related issues, please email security@slimframework.com instead of using the issue tracker.

Credits

License

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

统计信息

  • 总下载量: 65
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1968
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固