What is the best way to determine which Controller class a Kohana application is presently using?
Examples:
http://sitesite.com/–_defaultControllerName_http://somesite.com/frontpage/articles– “frontpage”http://somesite.com/contact/– “contact”
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.
The following applies to Kohana 2 instances…
You can do this by using the Router library. By default, this library is located in
/system/libraries/Router.php– go ahead and copy it into/application/librariesas is the standard practice for all libraries being used.Now, from within your application you can get the controller value from the static Router class:
Documentation