dlds/yii2-return-url

Yii2 ReturnUrl filter

Installs: 2 116

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 3

Type:yii2-extension

1.0.1 2015-05-28 22:15 UTC

This package is not auto-updated.

Last update: 2024-12-21 18:59:12 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.

Install via Composer

In "composer.json" your project, add the following lines:

"require": {
    ...
    "dlds/yii2-return-url": "*"
},

Then update your project:

php composer.phar update --prefer-dist

Usage

In your controller add ReturnUrl filter to behaviors:

public function behaviors()
{
    return [
        'returnUrl' => [
            'class' => 'dlds\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.