When should I use a library [solved] |
[eluser]katimari[/eluser]
Hi everyone - I'm only a week into working with CodeIgniter and have a pretty basic question. I have a controller that has some functions that I want to be accessible through a URL and some functions that I do not want to be accessible to the public. Should I be creating a library for the functions I don't want the public to access or is there a better way to handle this? Thanks for your help!
[eluser]Mischievous[/eluser]
Normally I use libraries when I don't need to access to any CI resources to get the job done. Otherwise I run with a model. But I believe I would keep all the functions or "thinking" to a model and just let the controller hand off the request to a model and then retrieve it and send it to a view. \/------------------- Controller -> Model ^ \/ View
[eluser]adamp1[/eluser]
Please read this section of the userguide for details on private controller functions. http://ellislab.com/codeigniter/user-gui...ml#private
[eluser]katimari[/eluser]
Thanks Adam - that is exactly the info I was looking for! |
Welcome Guest, Not a member yet? Register Sign In |