dongmei2956 2017-08-14 06:32
浏览 154
已采纳

获取yii2中重定向请求的URL?

Sorry for my English, but what I'm trying to say is explained below.

I have a controller say ControllerCard which has an action like this.

function actionScanCard()
{
    ...
    $this->redirect('/transaction/redeem');
    ...
}

In other controllers, ControllerTransaction, I am trying to get that it comes/redirected from /card/scan-card

function actionRedeem()
{
    $redirectFrom = ????;
    if ($redirectFrom === '/card/scan-card')
    {
        // some actions
    }
    else
        throw new ForbiddenHttpException('Must scan card!');
}

How do I get this $redirectFrom value with Yii2?

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 vivado如何支持多维打包数组模式
      • ¥15 请问第13题到底应该怎么做
      • ¥15 stable diffusion报错问题
      • ¥20 数据可视化综合运用 导入npz文件以及读取内容
      • ¥15 倒计时汇编语言RTC实时时钟
      • ¥15 CCS安装出现Failed to create the part's controls
      • ¥15 请问有digital Fortran编译器吗
      • ¥15 用cst怎么仿真同轴馈线
      • ¥15 如何在lammps中添加气液边界条件?
      • ¥20 具有每日记账功能的简易日历程序