A controller function can load another controllers?? |
[eluser]WanWizard[/eluser]
In standard CI, no, you can't. You can with a Modular solution, like Modular CI.
[eluser]ShoKatoo[/eluser]
[quote author="atoleon" date="1288037498"]Hi Can i load a controller like i load a view?[/quote] Please give an example... Is it something like calling a function declared in controller A from controller B? If that is so you can do this: Controller A Code: <?php Code: <?php You can now call function test_function() like http://localhost/contb/test_function even if you have no test_function() in Contb controller. The Contb controller extends the Conta controller inheriting all its function/methods. Have Phun! ![]()
[eluser]WanWizard[/eluser]
That's not one controller calling another, that is extending a class. Totally different concept.
[eluser]ShoKatoo[/eluser]
[quote author="ShoKatoo" date="1288045763"][...] The Contb controller extends the Conta controller inheriting all its function/methods.[...][/quote] Exactly what I said ![]()
[eluser]tonanbarbarian[/eluser]
if you find you have code in one controller that you would like to access from another controller then you probably need to move that common code into a library and then call the library from each controller |
Welcome Guest, Not a member yet? Register Sign In |