Welcome Guest, Not a member yet? Register   Sign In
Calling controller methods from inside view
#11

[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');
#12

[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?
#13

[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.
#14

[eluser]gtech[/eluser]
I shall have a go with it, thanks for the heads up. It would be nice to fully understand it.
#15

[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.
#16

[eluser]Unknown[/eluser]
Maybe this will help:

Calling Codeigniter Controller Methods from View File
#17

[eluser]InsiteFX[/eluser]
Did you read the dates of these posts?




Theme © iAndrew 2016 - Forum software by © MyBB