Welcome Guest, Not a member yet? Register   Sign In
Call a controller from a library
#1
Rainbow 

Hi guys,
some day ago I start to learn CI and a bit of MVC framework.
I follow this tutorial on youtube  about login system (using ion_auth was too difficult for me now).
While I follow the tutorial I've made some changes to let this compatible with CI3, correct some bug like xss_clean, ad adapt to my need.
Everything works, of course its not awesome but it works.
But, I want to learn I hate writing code and don't understand. So, I read that Controller in MVC paradigm, have to be used for build pages, load views, etc.
I don't like to have function like "form validation" in controller.
So I try to build a library with all function like logout, registration, login, validation, but I don't understand how I could let the library works.

My function on library call specific controller function, how can I call that function on controller but let that independent? so I could maybe think to reuse the library for other small project of mine?

thank you all in advance
Reply


Messages In This Thread
Call a controller from a library - by Psygnosis - 01-29-2016, 03:38 AM
RE: Call a controller from a library - by Narf - 01-29-2016, 03:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB