{"id":42499725,"url":"https://github.com/micheleangioni/phalcon-validators","last_synced_at":"2026-01-28T13:03:33.380Z","repository":{"id":62528173,"uuid":"57399487","full_name":"micheleangioni/phalcon-validators","owner":"micheleangioni","description":"New advanced validators for the PHP framework Phalcon.","archived":false,"fork":false,"pushed_at":"2018-01-02T09:33:05.000Z","size":35,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-19T09:34:21.653Z","etag":null,"topics":["phalcon","phalcon-validators","php","validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micheleangioni.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-29T16:48:04.000Z","updated_at":"2022-01-12T13:35:04.000Z","dependencies_parsed_at":"2022-11-02T10:32:03.633Z","dependency_job_id":null,"html_url":"https://github.com/micheleangioni/phalcon-validators","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/micheleangioni/phalcon-validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleangioni%2Fphalcon-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleangioni%2Fphalcon-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleangioni%2Fphalcon-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleangioni%2Fphalcon-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micheleangioni","download_url":"https://codeload.github.com/micheleangioni/phalcon-validators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micheleangioni%2Fphalcon-validators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["phalcon","phalcon-validators","php","validation"],"created_at":"2026-01-28T13:03:31.531Z","updated_at":"2026-01-28T13:03:33.364Z","avatar_url":"https://github.com/micheleangioni.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phalcon Validators\n\n[![License](https://poser.pugx.org/michele-angioni/phalcon-validators/license)](https://packagist.org/packages/michele-angioni/phalcon-validators)\n[![Latest Stable Version](https://poser.pugx.org/michele-angioni/phalcon-validators/v/stable)](https://packagist.org/packages/michele-angioni/phalcon-validators)\n[![Latest Unstable Version](https://poser.pugx.org/michele-angioni/phalcon-validators/v/unstable)](https://packagist.org/packages/michele-angioni/phalcon-validators)\n[![Build Status](https://travis-ci.org/micheleangioni/phalcon-validators.svg)](https://travis-ci.org/micheleangioni/phalcon-validators)\n\n\n## Introduction\n\nPhalcon Validators adds several new validators to the few default ones present in Phalcon.\n\nPHP 7.1+ and Phalcon 3.1 are required.\n \n## Installation\n\nSupport can be installed through Composer, just include `\"michele-angioni/phalcon-validators\": \"~2.0\"` to your composer.json and run `composer update` or `composer install`.\n\n## Usage\n\nThe new validators work in the same way the default validators do. \nJust pass a new instance of the validator to the Phalcon `Validation` class, with the desired options, and then validate it.\n \nAvailable validators with practical examples:\n\n### IpValidator\n\nThe IpValidator validates a valid ip address.\n\n```php\n$data['ip'] = $this-\u003erequest-\u003egetPost('ip');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'ip',\n    new MicheleAngioni\\PhalconValidators\\IpValidator (\n        [\n            'message' =\u003e 'The IP is not valid.'       // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n    \n}\n```\n\n// Validation succeeded without errors\n\n### NumericValidator\n\nThe default NumericValidator only allows for numeric (i.e. 0-9) characters.\nMinimum and maximum values can be specified.\n\nOptionally, it can support float values, that is allowing a dot (.) character to separate decimals.\n\nOptionally also signed numbers are supported.\n\n```php\n$data['number'] = $this-\u003erequest-\u003egetPost('number');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'number',\n    new MicheleAngioni\\PhalconValidators\\NumericValidator (\n        [\n            'allowFloat' =\u003e true,                                           // Optional, default: false\n            'allowSign' =\u003e true,                                            // Optional, default: false\n            'min' =\u003e 2,                                                     // Optional\n            'min' =\u003e 2,                                                     // Optional\n            'max' =\u003e 50,                                                    // Optional\n            'message' =\u003e 'Only numeric (0-9,.) characters are allowed.',    // Optional\n            'messageMinimum' =\u003e 'The value must be at least 2',             // Optional\n            'messageMaximum' =\u003e 'The value must be lower than 50'           // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n    \n}\n\n// Validation succeeded without errors\n```\n        \n### AlphaNumericValidator\n\nThe AlphaNumericValidator allows for alphanumeric characters. Optionally, it can allow underscores, minuses and white spaces.\nMinimum and maximum string lengths can be specified.\n\n```php\n$data['text'] = $this-\u003erequest-\u003egetPost('text');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'text',\n    new MicheleAngioni\\PhalconValidators\\AlphaNumericValidator (\n        [\n            'whiteSpace' =\u003e true,                                                       // Optional, default false\n            'underscore' =\u003e true,                                                       // Optional, default false\n            'minus' =\u003e true,                                                            // Optional, default false\n            'min' =\u003e 6,                                                                 // Optional\n            'max' =\u003e 30,                                                                // Optional     \n            'message' =\u003e 'Validation failed.',                                          // Optional\n            'messageMinimum' =\u003e 'The value must contain at least 6 characters.',        // Optional\n            'messageMaximum' =\u003e 'The value can contain maximum 30 characters.'          // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n    \n}\n\n// Validation succeeded without errors\n```\n\n### AlphaNamesValidator\n\nThe AlphaNamesValidator allows for alphabetic, menus, apostrophe, underscore and white space characters. \nOptionally, it can allow also numbers (i.t. 0-9).\nMinimum and maximum string lengths can be specified.\n\n```php\n$data['text'] = $this-\u003erequest-\u003egetPost('text');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'text',\n    new MicheleAngioni\\PhalconValidators\\AlphaNamesValidator (\n        [\n            'numbers' =\u003e true,                                                          // Optional, default false\n            'min' =\u003e 6,                                                                 // Optional\n            'max' =\u003e 30,                                                                // Optional     \n            'message' =\u003e 'Validation failed.',                                          // Optional\n            'messageMinimum' =\u003e 'The value must contain at least 6 characters.',        // Optional\n            'messageMaximum' =\u003e 'The value can contain maximum 30 characters.'          // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n    \n}\n\n// Validation succeeded without errors\n```\n\n### AlphaCompleteValidator\n\nThe AlphaCompleteValidator allows for alphanumeric, underscore, white space, slash, apostrophe, round and square brackets/parentheses and punctuation characters.\nOptionally, it can allow also pipes (|), ATs (@), backslashes (\\), percentages (%) and Url Characters (equals (=) and hashtags (#)).\nMinimum and maximum string lengths can be specified.\n\n```php\n$data['text'] = $this-\u003erequest-\u003egetPost('text');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'text',\n    new MicheleAngioni\\PhalconValidators\\AlphaCompleteValidator (\n        [\n            'allowBackslashes' =\u003e true,                                                 // Optional\n            'allowAt' =\u003e true,                                                          // Optional\n            'allowPipes' =\u003e true,                                                       // Optional\n            'allowPercentages' =\u003e true,                                                 // Optional\n            'allowUrlChars' =\u003e true,                                                    // Optional\n            'min' =\u003e 6,                                                                 // Optional\n            'max' =\u003e 30,                                                                // Optional     \n            'message' =\u003e 'Validation failed.',                                          // Optional\n            'messageMinimum' =\u003e 'The value must contain at least 6 characters.',        // Optional\n            'messageMaximum' =\u003e 'The value can contain maximum 30 characters.'          // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n    \n}\n\n// Validation succeeded without errors\n```\n\n### FileNameValidator\n\nThe FileNameValidator allows for a valid file name with extension, allowing simple letters, numbers underscores and minuses.\nOptionally, it can allow also all Latin characters, multiple dots and white spaces.\nMinimum and maximum string lengths can be specified.\n\n```php\n$data['text'] = $this-\u003erequest-\u003egetPost('text');\n\n$validation = new Phalcon\\Validation();\n\n$validation-\u003eadd(\n    'text',\n    new MicheleAngioni\\PhalconValidators\\FileNameValidator (\n        [\n            'allowMultipleDots' =\u003e true,                                                // Optional\n            'allowAllLatin' =\u003e true,                                                    // Optional\n            'allowSpaces' =\u003e true,                                                      // Optional\n            'min' =\u003e 6,                                                                 // Optional\n            'max' =\u003e 30,                                                                // Optional\n            'message' =\u003e 'Validation failed.',                                          // Optional\n            'messageMinimum' =\u003e 'The value must contain at least 6 characters.',        // Optional\n            'messageMaximum' =\u003e 'The value can contain maximum 30 characters.'          // Optional\n        ]\n    )\n);\n\n$messages = $validation-\u003evalidate($data);\n\nif (count($messages)) {\n    // Some error occurred, handle messages\n\n}\n\n// Validation succeeded without errors\n```\n\n## Contribution guidelines\n\nPhalcon Validators follows PSR-1, PSR-2 and PSR-4 PHP coding standards, and semantic versioning.\n\nPull requests are welcome.\n\n## License\n\nPhalcon Validators is free software distributed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheleangioni%2Fphalcon-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicheleangioni%2Fphalcon-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicheleangioni%2Fphalcon-validators/lists"}