I know this is not the best practice, but feels like i really need to reference another controller from some other controller.
Here is the deal -
1. I have service controller, which wraps some functionality of a web application.
2. The web application controller on every request verifies session.
3. In order to create a session in a service, I extend the Login controller, do the login and then i need to call for a controller of a web application.
I could simply duplicate the code, but this seems even worse then accessing controller.
If i simply instance the class, naturally the class has no controller context, thus, somehow i need to get reference to that controller from the CodeIgniter.
Any suggestions ?
Thank you in advance.
CodeIgniter - call another controller from a controller
Moderator: General Moderators
Re: CodeIgniter - call another controller from a controller
When the login controller finish doing its stuff, do a 302 redirect to the page you want the user to see next.
Re: CodeIgniter - call another controller from a controller
You actually can't call a controller within a controller, You can use helper to accomplish your task.
Or Can view this link to get a better idea
http://codeigniter.com/forums/viewthread/55212/
Or Can view this link to get a better idea
http://codeigniter.com/forums/viewthread/55212/