PHP code example of developer-av / yii2-request

1. Go to this page and download the library: Download developer-av/yii2-request 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/ */

    

developer-av / yii2-request example snippets


return [
    //....
    'components' => [
        'request' => [
            'class' => 'developerav\request\Request',
            'cookieValidationKey' => '************,
            'languages' => [
                'en' => 'en-US',//default language
                'ru' => 'ru-RU',
            ]
        ],
        'urlManager' => [
            'class' => 'developerav\request\UrlManager',
            'withoutWww' => true, // 301 redirect from www.exemple.com -> exemple.com
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
    ],
];

Html::a('test', ['', 'lang_id' => 'ru'])

php composer.phar