nezhelskoy/yii2-return-url

Yii2 ReturnUrl filter

Installs: 594

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 3

Open Issues: 0

Type:yii2-extension

v0.1.2 2016-04-19 17:34 UTC

This package is not auto-updated.

Last update: 2024-05-23 22:29:34 UTC


README

Keeps current URL in session for controller actions so we can return to it if needed.

This is Yii2 port of set-return-url-filter extension.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist nezhelskoy/yii2-return-url

Or add

"nezhelskoy/yii2-return-url": "~0.1.0"

to the require section of your composer.json file.

Usage

In your controller add ReturnUrl filter to behaviors:

public function behaviors()
{
    return [
        'returnUrl' => [
            'class' => 'nezhelskoy\returnUrl\ReturnUrl',
        ],
    ];
}

For access to previously visited url:

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

License

yii2-return-url is released under the BSD License. See LICENSE.md file for details.