Looking for little bit of advice on someting |
(03-20-2016, 09:14 AM)CodieNewbie Wrote: Thanks for the tip on requesting input data in the model Ahh right. It's good you are using those core functions. I've seen people try to roll their own hashing algorithms, and it usually ends up being terrible. There are many auth libraries out there. I know Ion auth and Community auth are very popular amongst codeigniter devs. You can also find several auth libraries on Packagist. As for your model and controller structures, I like to keep the model as isolated as possible. My model functions either return an object, or return NULL so I can unit test everything. Form data always gets filtered in my controllers before touching any of my models, and on top of the form validation, I validate data in the model before putting anything in my database. The way you have your model working now is the definition of coding with 'side effects' Though is is meant for another programming language (Erlang/Elixir), this is a very good article to read about side-effect: http://blog.jenkster.com/2015/12/what-is...mming.html
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
|
Messages In This Thread |
Looking for little bit of advice on someting - by CodieNewbie - 03-19-2016, 05:39 PM
RE: Looking for little bit of advice on someting - by albertleao - 03-19-2016, 10:03 PM
RE: Looking for little bit of advice on someting - by CodieNewbie - 03-20-2016, 07:14 AM
RE: Looking for little bit of advice on someting - by albertleao - 03-20-2016, 09:02 AM
RE: Looking for little bit of advice on someting - by albertleao - 03-20-2016, 09:04 AM
RE: Looking for little bit of advice on someting - by CodieNewbie - 03-20-2016, 09:14 AM
RE: Looking for little bit of advice on someting - by albertleao - 03-20-2016, 09:56 AM
RE: Looking for little bit of advice on someting - by PaulD - 03-20-2016, 11:29 AM
RE: Looking for little bit of advice on someting - by albertleao - 03-20-2016, 01:27 PM
|