【问题标题】:url::redirect in kohana 3.1kohana 3.1 中的 url::redirect
【发布时间】:2011-04-14 06:29:39
【问题描述】:

我在 kohana 3.1 中找不到函数 url::redirect
这个函数的新名字是什么? (如果它仍然存在!)

【问题讨论】:

    标签: php kohana


    【解决方案1】:

    在 Kohana 3 中已更改为...

    $this->request->redirect($newUrl);
    

    您可以在控制器中使用它。

    否则,请使用(如biakaveron 善意指出的那样)...

    Request::current()->redirect($newUrl);
    

    【讨论】:

    • Ko3.1 中没有Request::instance(),请改用Request::current()Request::initial()(可以从任何Request 对象进行重定向)。
    猜你喜欢
    • 2011-07-25
    • 2011-08-06
    • 2011-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-04
    • 2011-10-22
    相关资源
    最近更新 更多