承接 mimmi20/mezzio-setlocale-middleware 相关项目开发

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

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

mimmi20/mezzio-setlocale-middleware

最新稳定版本:2.0.3

Composer 安装命令:

composer require mimmi20/mezzio-setlocale-middleware

包简介

Provides a Middleware to set the Locale and the language to a translator

README 文档

README

Latest Stable Version Latest Unstable Version License

Code Status

codecov Average time to resolve an issue Percentage of issues still open Mutation testing badge

Introduction

This component provides middleware for Mezzio and PSR-7 applications to set the locale and the language for a translator based on the HTTP_ACCEPT_LANGUAGE Header.

Requirements

This library requires

  • PHP 8.3+.
  • a translator

Installation

Run

composer require mimmi20/mezzio-setlocale-middleware

Add the Middleware to the pipeline

<?php
return [
    'middleware' => [
        // ...
        \Mimmi20\Mezzio\Middleware\SetLocaleMiddleware::class, // <-- Add this line
        // ... <-- any middleware or request handler wich uses the translator
    ],
];

If you need the Translator for the Routing, you have to add the Middleware in the Pipeline before the Routing.

    $app->pipe(\Mimmi20\Mezzio\Middleware\SetLocaleMiddleware::class); // <-- Add this line

    // Register the routing middleware in the middleware pipeline.
    // This middleware registers the Mezzio\Router\RouteResult request attribute.
    $app->pipe(RouteMiddleware::class);

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固