Welcome Guest, Not a member yet? Register   Sign In
Models vs. Libraries (what goes where?)
#1

[eluser]tomdelonge[/eluser]
What goes in a library that doesn't go in a model? Are libraries just classes that are easily reused? I just can't figure out what to put in custom libraries vs. what to put in my models.

Just give me some tips on how to organize that.

Thanks.
#2

[eluser]Cro_Crx[/eluser]
Libraries are used for common tasks, eg handling sessions or form validation. Models are used to handle FilIO, 99% of the time it would contain all your database calls, although if you're reading/writing directly to files then this should go in your model as well.

Models are optional, although not using them detracts from the MVC programming approach.




Theme © iAndrew 2016 - Forum software by © MyBB