{"id":13623908,"url":"https://github.com/cakephp/validation","last_synced_at":"2025-06-25T23:07:19.227Z","repository":{"id":20077239,"uuid":"23346197","full_name":"cakephp/validation","owner":"cakephp","description":"[READ-ONLY] Validation library from CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp","archived":false,"fork":false,"pushed_at":"2025-05-17T03:14:26.000Z","size":702,"stargazers_count":42,"open_issues_count":0,"forks_count":9,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-17T04:21:31.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cakephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-26T09:27:04.000Z","updated_at":"2024-12-16T06:53:03.000Z","dependencies_parsed_at":"2023-01-13T20:45:41.880Z","dependency_job_id":"4b59fba1-1503-4830-a64f-fa185537b13d","html_url":"https://github.com/cakephp/validation","commit_stats":{"total_commits":536,"total_committers":72,"mean_commits":7.444444444444445,"dds":0.8190298507462687,"last_synced_commit":"d1c2ca7bc2bd6d7a03cefa751816ff66188b981a"},"previous_names":[],"tags_count":305,"template":false,"template_full_name":null,"purl":"pkg:github/cakephp/validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fvalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fvalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fvalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fvalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cakephp","download_url":"https://codeload.github.com/cakephp/validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fvalidation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261967132,"owners_count":23237663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:36.848Z","updated_at":"2025-06-25T23:07:19.202Z","avatar_url":"https://github.com/cakephp.png","language":"PHP","readme":"[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/validation.svg?style=flat-square)](https://packagist.org/packages/cakephp/validation)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt)\n\n# CakePHP Validation Library\n\nThe validation library in CakePHP provides features to build validators that can validate arbitrary\narrays of data with ease.\n\n## Usage\n\nValidator objects define the rules that apply to a set of fields. Validator objects contain a mapping between\nfields and validation sets. Creating a validator is simple:\n\n```php\nuse Cake\\Validation\\Validator;\n\n$validator = new Validator();\n$validator\n    -\u003erequirePresence('email')\n    -\u003eadd('email', 'validFormat', [\n        'rule' =\u003e 'email',\n        'message' =\u003e 'E-mail must be valid'\n    ])\n    -\u003erequirePresence('name')\n    -\u003enotEmptyString('name', 'We need your name.')\n    -\u003erequirePresence('comment')\n    -\u003enotEmptyString('comment', 'You need to give a comment.');\n\n$errors = $validator-\u003evalidate($_POST);\nif (!empty($errors)) {\n    // display errors.\n}\n```\n\n## Documentation\n\nPlease make sure you check the [official documentation](https://book.cakephp.org/4/en/core-libraries/validation.html)\n","funding_links":[],"categories":["目录","Table of Contents","PHP","过滤和验证 Filtering and Validation","过滤和验证( Filtering ang Validation )"],"sub_categories":["过滤和验证 Filtering and Validation","Filtering and Validation","Filtering, Sanitizing and Validation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcakephp%2Fvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fvalidation/lists"}