The default implementation raises an afterValidate event.
You may override this method to do postprocessing after validation.
Make sure the parent implementation is invoked so that the event can be raised.
public afterValidate ( ) |
errors) > 0) { // handle validation errors } else { // perform additional processing } parent::afterValidate(); } }In this example, the User model has two required attributes: username and password. The afterValidate() function is used to check if any validation errors were found, and if so, handle them appropriately. Otherwise, additional processing could be performed (for example, saving the user to the database or sending a confirmation email). This code example uses the yii\base\Model package library.
public afterValidate ( ) |