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"
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"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/libraries as 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:
print Router::$controller; // outputs current Controller