123456789101112131415161718192021222324252627 |
- <?php
- namespace common\fm;
- use Yii;
- use yii\helpers\StringHelper;
- use yii\helpers\ArrayHelper;
- class Request extends StringHelper
- {
- public static function Referer($modules = '')
- {
- $refArr = parse_url(Yii::$app->request->getReferrer());//上一页的URL
- $hostInfo = parse_url(Yii::$app->request->hostInfo); //当前URL
- if (!empty($refArr['host']) && $refArr['host'] == $hostInfo['host']) {
- return 'javascript:history.back(-1)';
- }
- if ($modules != '') {
- return '/' . $modules;
- }
- return '/';
- //
- }
- }
|