Welcome Guest, Not a member yet? Register   Sign In
Can't use $this->load->database() anywhere?
#4

[eluser]jedd[/eluser]
[quote author="victorpy" date="1239340320"]So if i add the line $CI = &get;_instance() before and use $CI->load.... i could call any of them, anywhere in the code... [/quote]

In effect, yes. Note that if you are using a database, there's a lot to be said for loading the database class in config/autoload.cfg rather than in each function (or indeed in each controller).

Quote:mmm... not documented? or i am a lazy reader haha

The CI User Manual maintains brevity, but contains [url="http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html"]everything you need[/url].


Messages In This Thread
Can't use $this->load->database() anywhere? - by El Forum - 04-09-2009, 04:31 PM
Can't use $this->load->database() anywhere? - by El Forum - 04-09-2009, 06:02 PM
Can't use $this->load->database() anywhere? - by El Forum - 04-09-2009, 06:12 PM
Can't use $this->load->database() anywhere? - by El Forum - 04-09-2009, 06:52 PM
Can't use $this->load->database() anywhere? - by El Forum - 04-09-2009, 07:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB