yii2-extensions/localeurls

Automatic locale/language management for URLs.

Fund package maintenance!
terabytesoftw

dev-main 2025-06-02 16:12 UTC

This package is auto-updated.

Last update: 2025-06-02 16:13:06 UTC


README

Locale URLs


PHP-Version Yii-22.0.52 Yii2-22 PHPUnit Mutation-Testing Static-Analysis Codecov

Installation

The preferred way to install this extension is through composer.

Either run

composer require --dev --prefer-dist yii2-extensions/localeurls

or add

"yii2-extensions/localeurls": "dev-main"

to the require-dev section of your composer.json file.

Configuration

To use this extension, you need to configure the urlManager component in your application configuration file.

'components' => [
    'urlManager' => [
        'class' => yii2\extensions\localeurls\UrlLanguageManager::class,
        'languages' => [
            'en' => 'en-US',
            'es' => 'es-ES',
            'ru' => 'ru-RU',
        ],
        'enablePrettyUrl' => true,
        'showScriptName' => false,
    ],    
],

Quality code

phpstan-level StyleCI

Testing

Check the documentation testing to learn about testing.

Our social networks

Twitter

License

The MIT License. Please see License File for more information.

Fork

This package is a fork of https://github.com/codemix/yii2-localeurls with some corrections.