Welcome Guest, Not a member yet? Register   Sign In
Looking for little bit of advice on someting
#7

(03-20-2016, 09:14 AM)CodieNewbie Wrote: Thanks for the tip on requesting input data in the model Smile

the "password_verify()" function is core php (PHP 5 >= 5.5.0) which verifies passwords created with "password_hash()" which uses the bcrypt algorithm by default.

As for auth i guess your right about using a 3rd party option.

Thanks again Smile

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!
Reply


Messages In This Thread
RE: Looking for little bit of advice on someting - by albertleao - 03-20-2016, 09:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB