PHPackages                             yiier/yii2-return-url - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. yiier/yii2-return-url

ActiveYii2-extension[Search &amp; Filtering](/categories/search)

yiier/yii2-return-url
=====================

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

v1.1.0(6y ago)99.2k61BSD-3-ClausePHP

Since Mar 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/yiier/yii2-return-url)[ Packagist](https://packagist.org/packages/yiier/yii2-return-url)[ RSS](/packages/yiier-yii2-return-url/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (1)

Yii2 Login ReturnUrl filter
===========================

[](#yii2-login-returnurl-filter)

[![Latest Stable Version](https://camo.githubusercontent.com/8c6ebd407847c834af0f8ab2f12c0a47cb993cb6dba641e40d8e2e075bf74538/68747470733a2f2f706f7365722e707567782e6f72672f79696965722f796969322d72657475726e2d75726c2f762f737461626c65)](https://packagist.org/packages/yiier/yii2-return-url)[![Total Downloads](https://camo.githubusercontent.com/f6f893acad48935dc448d578e9e91115347751923dd982c78eab5dad11fce93b/68747470733a2f2f706f7365722e707567782e6f72672f79696965722f796969322d72657475726e2d75726c2f646f776e6c6f616473)](https://packagist.org/packages/yiier/yii2-return-url)[![Latest Unstable Version](https://camo.githubusercontent.com/68f2b0488e89455968c23ad11ad931089c8da4ebb346c4eeafa8983d4312cc42/68747470733a2f2f706f7365722e707567782e6f72672f79696965722f796969322d72657475726e2d75726c2f762f756e737461626c65)](https://packagist.org/packages/yiier/yii2-return-url)[![License](https://camo.githubusercontent.com/8057388f9f2f680540007f0604df50d2e07a41b029ad0ef5960f34a5df763490/68747470733a2f2f706f7365722e707567782e6f72672f79696965722f796969322d72657475726e2d75726c2f6c6963656e7365)](https://packagist.org/packages/yiier/yii2-return-url)

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

中文说明：登录之后自动跳转登录之前的页面

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yiier/yii2-return-url "*"

```

or add

```
"yiier/yii2-return-url": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Method One (方式一，推荐)
-------------------

[](#method-one-方式一推荐)

you need to include it in config:

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

Method Two (方式二)
----------------

[](#method-two-方式二)

In your controller add ReturnUrl filter to behaviors:

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

For access to previously visited url:

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

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~358 days

Total

5

Last Release

2325d ago

Major Versions

v0.1.2 → v1.02020-02-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c0612f70d09feb06ab5d24a31e0cc551f1ee547b42308c695e34d76181f18cf?d=identicon)[forecho](/maintainers/forecho)

---

Top Contributors

[![forecho](https://avatars.githubusercontent.com/u/1725326?v=4)](https://github.com/forecho "forecho (8 commits)")

---

Tags

yiiyii2-behaviorsyii2-extensionfilteryii2returnUrl

### Embed Badge

![Health badge](/badges/yiier-yii2-return-url/health.svg)

```
[![Health](https://phpackages.com/badges/yiier-yii2-return-url/health.svg)](https://phpackages.com/packages/yiier-yii2-return-url)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[yii2mod/yii2-array-query

Yii2 component that allows for searching/filtering the elements of an array.

35171.9k9](/packages/yii2mod-yii2-array-query)[thrieu/yii2-grid-view-state

Save filters from GridView to session, keep the filter state between pages.

1313.5k1](/packages/thrieu-yii2-grid-view-state)[cyneek/yii2-routes

Routing and filtering extension system for Yii2 framework that emulates the Laravel routing system.

202.1k](/packages/cyneek-yii2-routes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
