Created
May 29, 2016 22:50
-
-
Save o-shabashov/092a718adaf8a362f3cf8684626668e7 to your computer and use it in GitHub Desktop.
Yii2 redirect to remembered URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Stored in session | |
Url::remember(['brands/vanity-iew', 'brand' => $brand->vanity_url], 'return-url'); | |
// Redirect if exist | |
if (Url::previous('return-url')) { | |
return $this->redirect(Url::previous('return-url')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment