Welcome Guest, Not a member yet? Register   Sign In
Model and Library , What different ?
#1

[eluser]Andychan[/eluser]
Actually, I tried to test that two, they can made same thing.
I don't clearly understand what's different about them.
#2

[eluser]toopay[/eluser]
Model is a class that intend to use with database abstraction, whether library is class that cantain some usefull function which you can use at your model or your controller.
#3

[eluser]theprodigy[/eluser]
another difference is that the model is an extension of CI, and therefore has access to basic CI functionality, where the library is an outside class. In order to gain access to CI, you have to use the get_instance() function.

Other than that, what @toopay said is pretty much correct. The model is used for database connections and business logic, where the library is more of an object you may use for mere functional means.

Example:
Your model may hold the functions for your checkout system (shopping cart, catalog, etc)
Your library would be an easy interface to Paypal, that you would use inside your model or controller.




Theme © iAndrew 2016 - Forum software by © MyBB