Determining Index v. Non-Index |
[eluser]netricate[/eluser]
I'm wondering if there is a more succinct way of determining if I am about the fire the index method than I am using. Currently, I have a couple checks in the class declarations that I don't want to fire if the index method is being called. Code: class A extends Controller { Any suggestions?
[eluser]netricate[/eluser]
I'm currently trying this one, I think it's better, but has one flaw Code: if($this->uri->segment(2)) //would return false if this is just index, but doesn't account for "url/a/index"
[eluser]netricate[/eluser]
I played with this above a little more and it seems to work for all cases (http://www.myurl.com/a/index just redirects to /a). I'm still interesting in finding out if anyone has a better/different way of doing it, but this works for now.
[eluser]richthegeek[/eluser]
Try $this->uri->rsegment if it's still giving issues, or some of the router methods/properties. You should be able to directly access the called method name from that. |
Welcome Guest, Not a member yet? Register Sign In |