PHP code example of anatoliy700 / yii2-redirect

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

    

anatoliy700 / yii2-redirect example snippets


'modules' => [
    'redirect' => [
         'class' => 'anatoliy700\redirect\Module',
    ]
]

 'container' => [
        'definitions' => [
             'anatoliy700\redirect\IRedirect' => 'anatoliy700\redirect\Redirect',
             'anatoliy700\redirect\repositories\IRepository' => [
                 'class' => 'anatoliy700\redirect\repositories\csv\CSVRepository',
                 'filePath' => '@app/redirectFile/redirect.csv',
             ],
             'anatoliy700\redirect\models\IRedirectItem' => 'anatoliy700\redirect\models\RedirectItem'
        ],
        'singletons' => [
             'krok\configure\ConfigureInterface' => function () {
                 $configurable = [
                     'anatoliy700\redirect\Configurable'
                 ];
                 $serializer = Yii::createObject('krok\configure\serializers\SerializerInterface');
                 
                 return new \krok\configure\Configure($configurable, $serializer);
             }
        ]
  ]

'components' => [
     'class' => 'yii\web\ErrorHandler',
      'errorAction' => 'redirect'
]