mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Validate类的is方法,添加data参数的默认值
This commit is contained in:
@@ -1409,7 +1409,7 @@ class Request
|
|||||||
* 生成请求令牌
|
* 生成请求令牌
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $name 令牌名称
|
* @param string $name 令牌名称
|
||||||
* @param string|array $type 令牌生成方法
|
* @param mixed $type 令牌生成方法
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function token($name = '__token__', $type = 'md5')
|
public function token($name = '__token__', $type = 'md5')
|
||||||
|
|||||||
@@ -480,9 +480,10 @@ class Validate
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @param mixed $value 字段值
|
* @param mixed $value 字段值
|
||||||
* @param string $rule 验证规则
|
* @param string $rule 验证规则
|
||||||
|
* @param array $data 验证数据
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function is($value, $rule, $data)
|
protected function is($value, $rule, $data = [])
|
||||||
{
|
{
|
||||||
switch ($rule) {
|
switch ($rule) {
|
||||||
case 'require':
|
case 'require':
|
||||||
|
|||||||
Reference in New Issue
Block a user