【发布时间】:2011-04-14 06:29:39
【问题描述】:
我在 kohana 3.1 中找不到函数 url::redirect
这个函数的新名字是什么? (如果它仍然存在!)
【问题讨论】:
我在 kohana 3.1 中找不到函数 url::redirect
这个函数的新名字是什么? (如果它仍然存在!)
【问题讨论】:
在 Kohana 3 中已更改为...
$this->request->redirect($newUrl);
您可以在控制器中使用它。
否则,请使用(如biakaveron 善意指出的那样)...
Request::current()->redirect($newUrl);
【讨论】:
Request::instance(),请改用Request::current() 或Request::initial()(可以从任何Request 对象进行重定向)。