Giter Club home page Giter Club logo

symfony-validation's Introduction

Symfony Validation


Latest version Build status Quantity score StyleCI Total download License

Thông tin

Symfony validation hổ trợ kiểm tra các kiểu dữ liệu đặc thù trong nước ta.

Cài đặt

  • Cài đặt Symfony Validation thông qua Composer:
composer require phpviet/symfony-validation
  • Tiếp đến hãy khai báo bundle tại config/bundles.php:
// config/bundles.php

return [
    .....
    PHPViet\Symfony\Validation\Bundle::class => ['all' => true]
];

Cách sử dụng

Các kiểu dữ liệu được hổ trợ kiểm tra hiện tại

Số điện thoại di động

    use PHPViet\Symfony\Validation\Constraints\MobileVN as AssertMobileVN;

    /**
     * @AssertMobileVN
     */
    private $mobileNumber;

Số điện thoại bàn

    use PHPViet\Symfony\Validation\Constraints\LandLineVN as AssertLandLineVN;

    /**
     * @AssertLandLineVN
     */
    private $landLineNumber;

Thẻ căn cước / chứng minh thư

    use PHPViet\Symfony\Validation\Constraints\IdVN as AssertIdVN;

    /**
     * @AssertIdVN
     */
    private $idVN;

Địa chỉ IP

    use PHPViet\Symfony\Validation\Constraints\IpVN as AssertIpVN;

    /**
     * @AssertIpVN
     */
    private $ipVN;
    
    /**
     * @AssertIpVN(version=4)
     */
    private $ipv4VN;    
    
    /**
     * @AssertIpVN(version=6)
     */
    private $ipv6VN;     

Dành cho nhà phát triển

Nếu như bạn cảm thấy các kiểu kiểm tra dữ liệu bên trên vẫn chưa đủ đối với thị trường trong nước và bạn muốn đóng góp để phát triển chung, chúng tôi rất hoan nghênh! Hãy tạo các issue để đóng góp ý tưởng cho phiên bản kế tiếp hoặc tạo PR để đóng góp thêm các kiểu kiểm tra dữ liệu còn thiếu sót. Cảm ơn!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.