CodeIgniter Forums
Best Pratice - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: Best Pratice (/thread-7707.html)

Best Pratice - El Forum - 04-20-2008

Hello Peeps.

Just looking for some advice.

Using the MVC pattern when would you want to use the libraries folder.

Im trying to get my head around the need for this folder.

Can you explain a good reason to use it.

Hope you can advise.

Best Pratice - El Forum - 04-20-2008

[eluser]Pascal Kriete[/eluser]
It's most commonly used for actions that you need more than once, so that you don't have any duplicate code in various controllers.

CI already has most of the libraries a normal application requires, but for more complex situtations you'll find yourself in need of some extra functionality. Take a look through the ignited code section, a lot of the stuff that gets posted there are libraries.

Hope that answered your question.

Best Pratice - El Forum - 04-20-2008

Great thanks.

Just thinking about what you said about it being able to share actions makes sense as you would not share a component.

Thats great thank you.

Best Pratice - El Forum - 04-20-2008

a good example to follow for you is /system/librairies, those are some of the core libs, don't be surprise to see that your own could be pretty much similar.

see ya around.