承接 middlewares/lowercase 相关项目开发

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

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

middlewares/lowercase

Composer 安装命令:

composer require middlewares/lowercase

包简介

A lowercase repository for PSR-15 middleware packages

README 文档

README

Latest Version on Packagist Software License Testing Total Downloads

Middleware to set the uri path to lowercase. For example, /Foo/Bar/ is converted to /foo/bar. Useful if you define your routes as lowercase and want to make your routes case insensitive.

Requirements

Installation

This package is installable and autoloadable via Composer as middlewares/lowercase.

composer require middlewares/lowercase

Example

$dispatcher = new Dispatcher([
    (new Middlewares\Lowercase())
        ->redirect()
        ->attribute('before-lowercase-uri')
]);

$response = $dispatcher->dispatch(new ServerRequest());

Usage

redirect

If the path must be converted to lowercase, this option returns a 301 response redirecting to the new lowercase path. Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface that will be used to create the redirect response. If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.

$responseFactory = new MyOwnResponseFactory();

//Simply set the path to lowercase
$lowercase = new Middlewares\Lowercase();

//Returns a redirect response to the new path
$lowercase = (new Middlewares\Lowercase())->redirect();

//Returns a redirect response to the new path using a specific response factory
$lowercase = (new Middlewares\Lowercase())->redirect($responseFactory);

attribute

If the path must be converted to lowercase, this method will store the original path in an atrribute.

// Save the original non-lowercase uri in the custom attribute "pre-lowercase-path"
$lowercase = (new Middlewares\Lowercase())->attribute('before-lowercase-uri');

Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固