Kohana 3 get current controller/action/arguments

前端 未结 3 1971
悲&欢浪女
悲&欢浪女 2021-02-02 13:18

In Kohana 2 you could easily get that information like this:

echo router::$controller;
echo router::$method;
echo router::$arguments[0-x];

Any

3条回答
  •  北海茫月
    2021-02-02 14:01

    For those using Kohana >= 3.1, it might be useful to notice that some properties of the Request object have been converted to methods.

    E.g. Request::controller is now Request::controller() (or $this->request->controller() when you're inside a controller).

    For more information, I'd like to reference to the Kohana upgrade guide on http://kohanaframework.org/3.1/guide/kohana/upgrading

提交回复
热议问题