PHP code example of yiier / yii2-return-url

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

    

yiier / yii2-return-url example snippets


return [
    'on beforeAction' => function ($event) {
        Yii::createObject([
            'class' => \yiier\returnUrl\ReturnUrl::class,
            'uniqueIds' => ['site/qrcode', 'site/login', 'site/signup']
        ])->beforeAction();
    },
    'components' => [
    ]
];

public function behaviors()
{
    return [
        'returnUrl' => [
            'class' => 'yiier\returnUrl\ReturnUrl',
            'uniqueIds' => ['site/qrcode', 'site/login', 'user/security/auth'] // 过滤掉不需要的 controller/action
        ],
    ];
}

Yii::$app->user->getReturnUrl();

php composer.phar