增加Validate类自定义验证错误信息的替换规则

This commit is contained in:
thinkphp
2016-12-06 13:59:37 +08:00
parent 81a8acb656
commit 4ebd16f8ef

View File

@@ -408,6 +408,7 @@ class Validate
return $message;
} elseif (true !== $result) {
// 返回自定义错误信息
$result = str_replace([':attribute', ':rule'], [$title, (string) $rule], $result);
return $result;
}
$i++;