Welcome Guest, Not a member yet? Register   Sign In
__call function equivalent.
#2

[eluser]mddd[/eluser]
__call is meant to handle requests to methods that do not exist in your class. However, in CI this doesn't happen (at least, not when calling a controller method) because CI checks if the method exists before trying to call it. If the method doesn't exist, CI will display an error, without trying. And so a __call method in your controller will never get called.

I think _remap is still your best option at the moment. I don't think it is so hard to make a _remap that simply checks if the called function is available. If so, you call it with all the arguments that were given. If not, you do your redirection to $this->index.


Messages In This Thread
__call function equivalent. - by El Forum - 06-18-2010, 05:21 AM
__call function equivalent. - by El Forum - 06-18-2010, 05:53 AM
__call function equivalent. - by El Forum - 06-18-2010, 06:26 AM
__call function equivalent. - by El Forum - 06-18-2010, 06:31 AM
__call function equivalent. - by El Forum - 06-18-2010, 06:46 AM
__call function equivalent. - by El Forum - 06-18-2010, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB