PHP code example of mg-code / yii2-url-manager

1. Go to this page and download the library: Download mg-code/yii2-url-manager 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/ */

    

mg-code / yii2-url-manager example snippets


return [
    'class' => 'yii\web\UrlManager',
    ......
    'rules' => [
       ['class' => 'mgcode\urlManager\HostUrlRule', 'host' => 'payment.example.com', 'rules' => [
            ['pattern' => '/', 'route' => '/payment/default/index'],
        ]],
    ]
];

return [
    'class' => 'yii\web\UrlManager',
    ......
    'rules' => [
        ['pattern' => '/some-old-link', 'route' => '/new/action', 'class' => 'mgcode\urlManager\RedirectUrlRule'],
    ]
];

$ php composer.phar