承接 z7zmey/slim-found-handler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

z7zmey/slim-found-handler

Composer 安装命令:

composer require z7zmey/slim-found-handler

包简介

Slim 3 found handler

README 文档

README

Instalation

$ composer require z7zmey/slim-found-handler

Application Configuration

$app = new \Slim\App([
    'foundHandler' => function () {
        return new \z7zmey\SlimFoundHandler();
    }
]);

Examples

You may use only required parameters

$app->get('/', function (\Slim\Http\Response $response) {
    $response->getBody()->write("Hello");
    return $response;
});

You can get access the route argument by using the same variable name

$app->get('/example1/{name}', function ($name) {
    echo "Hello, {$name}";
});

You can get access to all route arguments as array

$app->get('/example2/{first}/{second}', function (array $routeArguments) {
    echo "{$routeArguments['first']} {$routeArguments['second']}";
});

The sequence of parameters doesn't matter

use \Slim\Http\Response;
use \Slim\Http\Request;

$routeHandler = function ($first, Response $res, array $params, Request $req) {
    $second = $params['second'];
    $third = $req->getAttribute('route')->getArgument('third');

    $res->getBody()->write("{$first} {$second} {$third}");
    return $res;
};

$app->get('/example3/{first}/{second}/{third}', $routeHandler);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD
  • 更新时间: 2016-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固