In Kohana 2 you could easily get that information like this:
echo router::$controller;
echo router::$method;
echo router::$arguments[0-x];
Any idea how that works in Kohana 3?
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From inside a controller:
$this->request->controller$this->request->action$this->request->param('paramname')Unlike K2 arguments in K3 are accessed via kays which you define in your routes.
Take for example this url:
To access the “id” argument you’d call
$this->request->param('id')You can’t access the controller / action arguments from the param() method.
Note, you can also use
Request::instance()to get the global (or “master”) request instance.For more information see the K3 guide