zoukankan      html  css  js  c++  java
  • phalcon: model 验证数据完整性

    The above example performs a validation using the built-in validator “InclusionIn”. It checks the value of the field “type” in a domain list. If the value is not included in the method then the validator will fail and return false. The following built-in validators are available:

    NameExplanationExample
    PresenceOf Validates that a field’s value isn’t null or empty string. This validator is automatically added based on the attributes marked as not null on the mapped table Example
    Email Validates that field contains a valid email format Example
    ExclusionIn Validates that a value is not within a list of possible values Example
    InclusionIn Validates that a value is within a list of possible values Example
    Numericality Validates that a field has a numeric format Example
    Regex Validates that the value of a field matches a regular expression Example
    Uniqueness Validates that a field or a combination of a set of fields are not present more than once in the existing records of the related table Example
    StringLength Validates the length of a string Example
    Url Validates that a value has a valid URL format Example

  • 相关阅读:
    使用gunicorn部署flask项目
    加密算法详解
    elasticsearch安装
    elk下载链接
    mysql允许远程连接
    工作流源代码分析
    查看账户的访问token
    Kube-proxy组件
    创建服务账户/查询访问token
    K8s概念2
  • 原文地址:https://www.cnblogs.com/achengmu/p/5879738.html
Copyright © 2011-2022 走看看