2016-06-23 21:32:12 3408次浏览 2条回答 0 悬赏 10 金钱

return $this->redirect('catalog/list');
上面的代码直接转到
frontend/web/catalog/list
来了
我想让他根据URL设置判断转到
frontend/web/index.php?r=catalog/list
或是
frontend/web/catalog/list

该怎么写呢?

最佳答案

  • 白狼栈 发布于 2016-06-23 22:28 举报
    $url = \yii\helpers\Url::toRoute('catalog/list');
    return $this->redirect($url);
    
    2 条回复
    回复于 2016-06-24 09:55 回复

    完美解决问题。

    回复于 2016-10-04 13:25 回复

    白狼的答案确实是一针见血!

    觉得很赞
您需要登录后才可以回答。登录 | 立即注册
okokad
经理

okokad

注册时间:2016-02-29
最后登录:2017-07-01
在线时长:49小时26分
  • 粉丝12
  • 金钱25
  • 威望80
  • 积分1315

热门问题