Welcome Guest, Not a member yet? Register   Sign In
Use libraries in self created libraries
#1

[eluser]Joozt[/eluser]
I would like to know if this is possible?

I am building some library classes, witch need some data from my database.

Is it possible to load a libary in a library? if so how?

Thanks alot!
#2

[eluser]zdknudsen[/eluser]
EDIT: Read answer below. More precise.
#3

[eluser]BizComputing[/eluser]
Simple answer, yes.

More complicated answer, get a reference to the active controller via $ci =& get_instance();, then use $ci->load->library(...).

Although based on your question, seems more appropriate to be loading a model from your library. Although I guess with the openness of CI, you don't have to use models for your data access.
#4

[eluser]BizComputing[/eluser]
Zacharias, you can use load directly against a library?

I'll have to check that out, I may have been wasting all my time saving refs to the active controller.
#5

[eluser]zdknudsen[/eluser]
No you can't. Just me being euphoric from finally having weekend and not thinking right. Smile
#6

[eluser]BizComputing[/eluser]
lol, well, to give yourself some credit, you would be correct in direct loading if the OP was talking about a model.

Oh, and you get the privilege of getting the reply from me that graduated me from Noob to Jr Member.
#7

[eluser]zdknudsen[/eluser]
*Finds "things to do before i die" checklist. Ticks off "help member graduate to Junior Member". Dies.*
#8

[eluser]Tom Glover[/eluser]
[quote author="Zacharias Knudsen" date="1201899016"]*Finds "things to do before i die" checklist. Ticks off "help member graduate to Junior Member". Dies.*[/quote]

LOL :vampire:




Theme © iAndrew 2016 - Forum software by © MyBB