Welcome Guest, Not a member yet? Register   Sign In
Why use libraries? (Authentication)
#1

[eluser]regal2157[/eluser]
Okay, I've spent a lot of time looking at methods of how people make authentication systems. I've looked at tank_auth, a3m, freak_auth, and others but I don't get one thing - why the libraries.

I guess the basic layout for an auth system is:
/models/auth_model.php
/controllers/auth_controller.php
/library/auth_lib.php
/config/auth_config.php
/views/auth_views/...

I am hoping someone here can explain to me why the functions are spread further out to libraries and not kept in the controller? The user_guide says it allows seperation from the CI Resources, but most already include the get_instance() function..

Advantages I see:
Cleaner code - keeps processing functions in the library, while the controller is kept for "pages" or "actions."

Anyways, if you can explain it to me, that would be great Smile Or point me to some good articles on it. I've read a few, but I'm curious as to why you use a library.

Thanks in advance,
John




Theme © iAndrew 2016 - Forum software by © MyBB