Welcome Guest, Not a member yet? Register   Sign In
How to get the Controller name and/or View name being used
#11

[eluser]Johan André[/eluser]
What about if the controller is in a subdir?

application/controllers/subdir/the_controller.php

would be called with {base_url}/subdir/the_controller/method/param1

Correct me if I'm wrong, but wouldn't rsegment(1) return the name of subdir?
#12

[eluser]chuckleberry13[/eluser]
For the controller you can use
Code:
$this->router->class
and for the method (function) use
Code:
$this->router->method

It will work regardless of any custom routing.

I don't know about getting the view.




Theme © iAndrew 2016 - Forum software by © MyBB