core/Form.php
public function validation(&$errors = null)
    {
        $fields = $this->getFields();
        if (method_exists($this, 'beforeValid')) {
            $this->beforeValid($fields);
        }
        $result = true;
        foreach ($fields as $field) {
            $this->validDynamic($field);
        }
        foreach ($fields as $name => $field) {
            if (!empty($field->error)) {
                $result = false;
                continue;
            }
            if ($field->close || ($field->offEdit && $this->type == 'edit')) {
                continue;
            }
            $ret = $this->getValidate()->checkField($field);
            if (!$ret) {
                $result = false;
            }
        }
        if (method_exists($this, 'afterValid')) {
            $this->afterValid($fields);
        }
        $errors = $this->getAllError();
        if (count($errors) > 0) {
            return false;
        }
        return $result;
    }
public function validation(&$errors = null)
    {
        $fields = $this->getFields();
        if (method_exists($this, 'beforeValid')) {
            $this->beforeValid($fields);
        }
        $result = true;
        foreach ($fields as $field) {
            $this->validDynamic($field);
        }
        foreach ($fields as $name => $field) {
            if (!empty($field->error)) {
                $result = false;
                continue;
            }
            if ($field->close || ($field->offEdit && $this->type == 'edit')) {
                continue;
            }
            $ret = $this->getValidate()->checkField($field);
            if (!$ret) {
                $result = false;
            }
        }
        if (method_exists($this, 'afterValid')) {
            $this->afterValid($fields);
        }
        $errors = $this->getAllError();
        if (count($errors) > 0) {
            return false;
        }
        return $result;
    }
验证表单
@param null $errors
@return bool