Skip to content

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

License

Notifications You must be signed in to change notification settings

dlds/yii2-return-url

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 ReturnUrl filter

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%