Unique Validator Not Work

I have a rules snippet that looks like this…




			[['email', 'password', 'timezone', 'display_name'], 'required'],

			[['email'], 'email'],

			[['display_name', 'email'], 'unique']



I get a white screen when the unique validator fails. The other two validators appear to work fine. Not sure whats up.

Figured it out. The problem was the logic in my controller. Was set to redirect after validation but not told to do anything else if validation failed because of the way I had structured my if, else statements.

modify [[‘display_name’, ‘email’], ‘unique’]

into [[‘display_name’, ‘email’], ‘unique’, ‘targetClass’ => ‘\app\models\Users’], Users model is where has email attribute.This model will check unique for email automatically.