Welcome Guest, Not a member yet? Register   Sign In
Can Any body give me explanation and example for function _remap() and function _output() ?
#2

[eluser]PhilTem[/eluser]
Function _remap() is used when you wan't to - who would have thought - remap function calls. Usually, the method executed is determined by the URI, e.g.
Code:
example.com/user/login

calls method login of controller user. But if you want to make something like e.g. a gallery with urls like

Code:
example.com/gallery/my-awesome-gallery

where my-awesome-gallery will be your gallery name, you would actually have to create a method called my-awesome-gallery within your gallery controller. But if you used the _remap() method, it will be called with my-awesome-gallery as first argument.
So you can grab method execution before they are executed (when a _remap()-method is found by the CI super-object it's called no matter what - even if a my-awesome-gallery-method existed).

It's basically some other usage of routing - since routing can be used for first-level dynamic uris (in the previous examples gallery as well as user are first-level dynamic uris. You just clear your mind about whether you want to use routes or _remap or both Wink

Method _output(): Never seen it, don't know about it Big Grin Sorry for that^^


Messages In This Thread
Can Any body give me explanation and example for function _remap() and function _output() ? - by El Forum - 03-02-2012, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB