![]() |
Calling controller methods from inside view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Calling controller methods from inside view (/showthread.php?tid=8746) Pages:
1
2
|
Calling controller methods from inside view - El Forum - 05-30-2008 [eluser]wiredesignz[/eluser] ME has its own controller class with that method, and all controllers are extensions of that so they all contain their own instance method. You are also able to access a CI core class using instance: Code: controller::instance('config')->item('base_url'); Calling controller methods from inside view - El Forum - 05-30-2008 [eluser]gtech[/eluser] That sounds quite neat, do you prevent views from calling methods in the top level controller (i.e. not the base module controller, but the controller that has been extended from the module class), or is it a free for all? Calling controller methods from inside view - El Forum - 05-30-2008 [eluser]wiredesignz[/eluser] the view can only access the controller that loaded it using that method. But using modules::run() allows you to load and run any controller from any view and return its output, be it a partial or data. modules::run does not attach the called controller to any object. it simply sits in memory waiting to be re-used. Calling controller methods from inside view - El Forum - 05-30-2008 [eluser]gtech[/eluser] I shall have a go with it, thanks for the heads up. It would be nice to fully understand it. Calling controller methods from inside view - El Forum - 05-30-2008 [eluser]metaltapimenye[/eluser] yep..thx for the heads up wiredesignz. i got lost track 4 now about Modular Extension, ill see ModExt's wiki for further understanding..n_n. @gtech ..thx for your offer,im kind a newbie here. ill send u PM after this. little bit related with 'view' topic..is there any Obfuscator CI's libs ever introduced?..ill shout it in new topic after this. thx. Calling controller methods from inside view - El Forum - 05-20-2012 [eluser]Unknown[/eluser] Maybe this will help: Calling Codeigniter Controller Methods from View File Calling controller methods from inside view - El Forum - 05-20-2012 [eluser]InsiteFX[/eluser] Did you read the dates of these posts? |