public static function getMaxLength($model, $attribute, $defaultValue = null)
	{
		$maxLength = null;
		foreach ($model->getActiveValidators($attribute) as $validator) {
			if ( $validator instanceof yii\validators\StringValidator) {
				$maxLength = $validator->max;
				break;
			}
		}
		return $maxLength !== null ? $maxLength : $defaultValue;
	}