VC names |
[eluser]Nevio[/eluser]
Hi people. Maybe I'm stupid ( didn't found solution over search function ) but I'm interested if there is any methods like get_controller_name() or get_view_name()? I really need em and if there is no solutions like this that I know to develop it. Cheers.
[eluser]xwero[/eluser]
The "heavy" way to get the controller is Code: $RTR =& load_class('Router'); Code: $class = $this->uri->rsegment(1);
[eluser]wiredesignz[/eluser]
The router class has been available as an object variable since CI 1.7, like so Code: $this->router->fetch_class()
[eluser]brianw1975[/eluser]
call me crazy but can't you use the get_class() function? (assuming you are using PHP5.0+) http://us.php.net/get_class
[eluser]Nevio[/eluser]
Hehehe. Yea I can. Now what I'm doin. Finding out controller and view to be able automatically load javascript page for it based on controller and view position. Because there can be used rewite route, it can be a little bit buggy if I do it over "normal" way. ( need to know which method, class and view loaded in order to be able do it how I like. ) Want to brainstorm complete CI so I'm looking for a hard way always Thanks for info. I really appreciate it. Now I go play a little bit with it. Anyway, now I found it lol. Sorry for that, but kinda sometimes I know to ask really stupid questions indeed. |
Welcome Guest, Not a member yet? Register Sign In |