Welcome Guest, Not a member yet? Register   Sign In
internal redirect
#6

[eluser]esra[/eluser]
[quote author="emilper" date="1191415801"]redirect() tells the browser to connect to the new url.

What I was inquiring for was a method to call a controller from another controller. I have found that I can call, from withing the same controller, another method, which is an "internal redirect".

It would be nice if there were a way to give up execution to another controller, i.e. another method in another controller class.

Code Igniter is cool, anyway, and even if such thing is not possible, I'll stick with it for the current project Smile

thanks to all that answered

E.[/quote]

I have not tried the feature myself, but the latest version of the Modular Separation extensions by Zacharias does allow controllers to call methods in other controllers. However, I do use modular separation. This was handled by adding new methods to the Loader and Router libraries via extensions. If you're interested, there is a wiki articles as well as a long thread. The functionality has nothing to do with redirects.

If modular separation is not to your liking, you can create a base controller class and extend all of your controller classes from that base controller. In the base controller, you could place any methods you want to share among your controllers or load a library in base controller's constructor with the methods you want to share.


Messages In This Thread
internal redirect - by El Forum - 10-02-2007, 02:53 AM
internal redirect - by El Forum - 10-02-2007, 04:00 AM
internal redirect - by El Forum - 10-03-2007, 01:42 AM
internal redirect - by El Forum - 10-03-2007, 01:50 AM
internal redirect - by El Forum - 10-03-2007, 01:55 AM
internal redirect - by El Forum - 10-03-2007, 02:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB