CodeIgniter - call another controller from a controller
Posted: Mon Aug 29, 2011 11:16 am
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.
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.