password encryption why in User model and not in actionCreate
Posted 10 August 2011 - 05:25 AM
In page 159, password encryption functionality is added using CActiveRecord::afterValidate() method. I'm pondering about the alternative way of implementing encryption in UserController::actionCreate().
Besides the educational purpose of showing us the afterValidate() method, what are the pros and cons of both places?
Posted 10 August 2011 - 07:42 AM
Off course you could encrypt your password in controller, after it pass(if) validation, but I like more solution explained in book.
Posted 10 August 2011 - 09:05 AM