Code Monkey home page Code Monkey logo

apollon's Introduction

Apollon

Description

validation plugin for CakePHP 5.x.

Requirements

  • PHP >= 8.1.*
  • CakePHP >= 5.*

Install

composer require fusic/apollon

Usage

In Model File

private function setValidationProvider(Validator $validator)
    {
       $validator->setProvider('apollon', 'Apollon\Validation\ApollonValidation');
       return $validator;
    }
public function validationDefault(Validator $validator)
    {
        $this->setValidationProvider($validator);
        $validator
            ->scalar('password')
            ->requirePresence('password', 'create')
            ->notEmpty('password', 'パスワードを入力してください')
            ->add('password', 'password',[
                'rule' => 'alphaNumericSymbols',
                'provider' => 'apollon',
                'message' => 'パスワードは半角英数記号で入力してください'
            ]);
    }

Validation List

  • zip
    • 郵便番号チェック 1カラム
  • zip1
    • 郵便番号チェック 上3桁
  • zip2
    • 郵便番号チェック 下4桁
  • alpha
    • 半角英字チェック
  • numeric
    • 数値チェック(integerなどの上限チェックを同時に行う)
  • naturalNumber
    • 数値チェック(integerなどの上限チェックを同時に行う)
  • hiraganaOnly
    • 全角ひらがなチェック
  • hiraganaSpaceOnly
    • 全角ひらがな+全角スペースチェック
  • katakanaOnly
    • 全角カタカナチェック
  • katakanaSpaceOnly
    • 全角カタカナ+全角スペースチェック
  • zenkakuOnly
    • 全角のみチェック
  • spaceOnly
    • スペースのみはエラーチェック
  • hankakukatakanaOnly
    • 半角カタカナチェック
  • hankakukatakanaSpaceOnly
    • 半角カタカナ+半角スペースチェック
  • phone
    • 電話番号チェック(ハイフン有無しOK)
  • phone1
    • 電話番号チェック 上2~5桁
  • phone2
    • 電話番号チェック 中2~4桁
  • phone3
    • 電話番号チェック 下4桁
  • emailNonRfc
    • メールアドレスチェック(RFC非準拠)
  • datetimeComparison
    • 日時比較チェック

apollon's People

Contributors

ayasamind avatar junkins avatar kozo avatar raiu1210 avatar satthi avatar scrutinizer-auto-fixer avatar tsukabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apollon's Issues

メソッドの命名規則について

zipCheck のように Check がついていたり alpha のようになかったりバラバラなのが嫌なので、coreに合わせて Check を外さない?

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.