PHPackages                             daxslab/yii2-localeurls - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. daxslab/yii2-localeurls

ActiveYii2-extension[Localization &amp; i18n](/categories/localization)

daxslab/yii2-localeurls
=======================

Automatic locale/language management for URLs.

1.0.0(8y ago)0227MITPHP

Since Mar 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/daxslab/yii2-localeurls)[ Packagist](https://packagist.org/packages/daxslab/yii2-localeurls)[ RSS](/packages/daxslab-yii2-localeurls/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Yii2 Locale URLs
================

[](#yii2-locale-urls)

[![Build Status](https://camo.githubusercontent.com/a4b82951c88d8b731458f5799e6788e186a839a9a5122ca0a7aecad3fe6b4d60/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646178736c61622f796969322d6c6f63616c6575726c732e706e67)](http://travis-ci.org/daxslab/yii2-localeurls)[![Latest Stable Version](https://camo.githubusercontent.com/dd419cec3c46b74e4dcd8b70b4cfe4e4dc0ef6c9e67a30e558488cbf9e6e45a3/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d6c6f63616c6575726c732f762f737461626c652e737667)](https://packagist.org/packages/daxslab/yii2-localeurls)[![Total Downloads](https://camo.githubusercontent.com/cafa29de1d47716b54ede608afd89d8a8e31b47839a3872b9e4601db94f732f9/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d6c6f63616c6575726c732f646f776e6c6f616473)](https://packagist.org/packages/daxslab/yii2-localeurls)[![Latest Unstable Version](https://camo.githubusercontent.com/c8e2b01d56c11aa41d6964c64855f08e562ee444c0b6328944c19198f38a5216/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d6c6f63616c6575726c732f762f756e737461626c652e737667)](https://packagist.org/packages/daxslab/yii2-localeurls)[![License](https://camo.githubusercontent.com/399c847343a53a6b50cee391f6bd227d50983e3eb7ae9b38fb194434aaff664f/68747470733a2f2f706f7365722e707567782e6f72672f646178736c61622f796969322d6c6f63616c6575726c732f6c6963656e73652e737667)](https://packagist.org/packages/daxslab/yii2-localeurls)

Forked from codemix/yii2-localeurls, Automatic locale/language management through URLs for Yii 2.

> **IMPORTANT:** If you upgraded from version 1.0.\* you have to modify your configuration. Please check the section on [Upgrading](#upgrading) below.

Features
--------

[](#features)

With this extension you can use URLs that contain a language code like:

```
/en/some/page
/de/some/page
http://www.example.com/en/some/page
http://www.example.com/de/some/page

```

You can also configure friendly names if you want:

```
http://www.example.com/english/some/page
http://www.example.com/deutsch/some/page

```

The language code is automatically added whenever you create a URL, and read back when a URL is parsed. For best user experience the language is autodetected from the browser settings, if no language is used in the URL. The user can still access other languages, though, simply by calling a URL with another language code.

The last requested language is also persisted in the user session and in a cookie. So if the user tries to access your site without a language code in the URL, he'll get redirected to the language he had used on his last visit.

All the above (and more) is configurable of course.

Installation
------------

[](#installation)

Install the package through [composer](http://getcomposer.org):

```
composer require daxslab/yii2-localeurls

```

And then add this to your application configuration:

```
