1. Go to this page and download the library: Download mikehaertl/localeurls library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mikehaertl / localeurls example snippets
return array(
// ...
'components' => array(
// ...
'urlManager' => array(
'class' => 'ext.localeurls.LocaleUrlManager',
// Advanced configuration with defaults (see below)
//'languageParam' => 'language',
),
'request' => array(
'class' => 'ext.localeurls.LocaleHttpRequest',
'languages' => array('en_us','en','de','fr'),
// Since version 1.1.3 you can also map url => language
// 'languages' => array(
// 'english' => 'en',
// 'deutsch' => 'de',
// 'fr',
// )
// Advanced configuration with defaults (see below)
//'detecLanguage' => true,
//'languageCookieLifetime' => 31536000,
//'persistLanguage' => true,
//'redirectDefault' => false,
),
// ...
),
);