| 1234567891011121314151617181920212223242526272829 |
- <?php
- namespace UCore\Validator;
- use UCore\Exception\ValidateException;
- trait ValidationMessage
- {
- /**
- * 抛出验证错误的异常
- * @param $value
- * @param string $message 消息模版
- * @param string $msg
- * @return mixed
- * @throws ValidateException
- */
- public function throwMessage($p, $msgTpl)
- {
- // dd(strtr($msgTpl, $p),$msgTpl,$p);
- throw new ValidateException($this->validation, strtr($msgTpl, $p));
- }
- }
|