1. Go to this page and download the library: Download dlds/yii2-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/ */
dlds / yii2-localeurls example snippets
return [
// ...
'bootstrap' => ['localeUrls'],
// ...
'components' => [
// ...
'localeUrls' => [
'class' => 'dlds\localeurls\LocaleUrls',
// List all supported languages here
'languages' => ['en_us', 'en', 'fr', 'de']
]
// Override the urlManager component
'urlManager' => [
'class' => 'dlds\localeurls\UrlManager',
]
// ...
]
];