per-seo/locale 问题修复 & 功能扩展

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

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

per-seo/locale

最新稳定版本:1.1.2

Composer 安装命令:

composer require per-seo/locale

包简介

Language in URI for Slim 4. This Middleware add an attribute 'locale' to the request object, to help with page translation for SEO.

README 文档

README

A simple middleware for Slim4 framework for using locale in uri. Usage is very simple, just add in your container settings this array:

'settings_global' => [
        'language' => 'it',
        'languages' => ['it', 'en'],
		    'locale' => true,
]

And enable this Middleware (in the Middleware part of your Slim4 Project) with:

<?php

use PerSeo\Middleware\Locale\Locale;

$app->add(Locale::class);

After this, all your Slim 4 routes works without the language prefix in routes (because this Middleware check the language before routes are called). To retrive what language the project is using, just call:

$request->getAttribute('locale');

Simple, isn't it?

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-20