Welcome Guest, Not a member yet? Register   Sign In
When should I use a library [solved]
#1

[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!
#2

[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
#3

[eluser]adamp1[/eluser]
Please read this section of the userguide for details on private controller functions. http://ellislab.com/codeigniter/user-gui...ml#private
#4

[eluser]laralaya[/eluser]
thanks for the nice information
#5

[eluser]katimari[/eluser]
Thanks Adam - that is exactly the info I was looking for!




Theme © iAndrew 2016 - Forum software by © MyBB