{"id":13411363,"url":"https://github.com/yiier/yii2-return-url","last_synced_at":"2025-10-25T17:30:56.427Z","repository":{"id":57087118,"uuid":"53997422","full_name":"yiier/yii2-return-url","owner":"yiier","description":"Yii2 Login ReturnUrl filter 中文说明：登录之后自动跳转登录之前的页面","archived":false,"fork":false,"pushed_at":"2020-02-17T14:29:05.000Z","size":6,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T01:58:59.540Z","etag":null,"topics":["yii","yii2-behaviors","yii2-extension"],"latest_commit_sha":null,"homepage":"http://www.getyii.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-16T03:18:59.000Z","updated_at":"2023-05-27T12:43:11.000Z","dependencies_parsed_at":"2022-08-24T22:50:51.342Z","dependency_job_id":null,"html_url":"https://github.com/yiier/yii2-return-url","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiier%2Fyii2-return-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiier%2Fyii2-return-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiier%2Fyii2-return-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiier%2Fyii2-return-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiier","download_url":"https://codeload.github.com/yiier/yii2-return-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238012757,"owners_count":19401882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["yii","yii2-behaviors","yii2-extension"],"created_at":"2024-07-30T20:01:13.158Z","updated_at":"2025-10-25T17:30:50.953Z","avatar_url":"https://github.com/yiier.png","language":"PHP","funding_links":[],"categories":["Extension 扩展"],"sub_categories":[],"readme":"Yii2 Login ReturnUrl filter\n===========================\n[![Latest Stable Version](https://poser.pugx.org/yiier/yii2-return-url/v/stable)](https://packagist.org/packages/yiier/yii2-return-url) \n[![Total Downloads](https://poser.pugx.org/yiier/yii2-return-url/downloads)](https://packagist.org/packages/yiier/yii2-return-url) \n[![Latest Unstable Version](https://poser.pugx.org/yiier/yii2-return-url/v/unstable)](https://packagist.org/packages/yiier/yii2-return-url) \n[![License](https://poser.pugx.org/yiier/yii2-return-url/license)](https://packagist.org/packages/yiier/yii2-return-url)\n\nKeeps current URL in session for login actions so we can return to it if needed.\n\n中文说明：登录之后自动跳转登录之前的页面\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist yiier/yii2-return-url \"*\"\n```\n\nor add\n\n```\n\"yiier/yii2-return-url\": \"*\"\n```\n\nto the require section of your `composer.json` file.\n\n\nUsage\n-----\n\n## Method One (方式一，推荐)\n\nyou need to include it in config:\n\n```php\nreturn [\n    'on beforeAction' =\u003e function ($event) {\n        Yii::createObject([\n            'class' =\u003e \\yiier\\returnUrl\\ReturnUrl::class,\n            'uniqueIds' =\u003e ['site/qrcode', 'site/login', 'site/signup']\n        ])-\u003ebeforeAction();\n    },\n    'components' =\u003e [\n    ]\n];\n```\n\n\n## Method Two (方式二)\n \nIn your controller add ReturnUrl filter to behaviors:\n\n```php\npublic function behaviors()\n{\n    return [\n        'returnUrl' =\u003e [\n            'class' =\u003e 'yiier\\returnUrl\\ReturnUrl',\n            'uniqueIds' =\u003e ['site/qrcode', 'site/login', 'user/security/auth'] // 过滤掉不需要的 controller/action\n        ],\n    ];\n}\n```\n\nFor access to previously visited url:\n\n```php\nYii::$app-\u003euser-\u003egetReturnUrl();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiier%2Fyii2-return-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiier%2Fyii2-return-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiier%2Fyii2-return-url/lists"}