{"id":28713863,"url":"https://github.com/mintyphp/forms","last_synced_at":"2026-03-12T01:02:04.934Z","repository":{"id":293637714,"uuid":"984673964","full_name":"mintyphp/forms","owner":"mintyphp","description":"PHP Form builder with Bulma support","archived":false,"fork":false,"pushed_at":"2025-09-05T12:49:28.000Z","size":166,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T20:52:10.361Z","etag":null,"topics":["bulma","form-builder","form-handling","form-validation","forms-generator","php-form","php-form-builder","php-forms"],"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/mintyphp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T10:12:01.000Z","updated_at":"2025-09-05T12:49:31.000Z","dependencies_parsed_at":"2025-06-09T08:16:00.804Z","dependency_job_id":null,"html_url":"https://github.com/mintyphp/forms","commit_stats":null,"previous_names":["mintyphp/forms"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/mintyphp/forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintyphp%2Fforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintyphp%2Fforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintyphp%2Fforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintyphp%2Fforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mintyphp","download_url":"https://codeload.github.com/mintyphp/forms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintyphp%2Fforms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30410356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"ssl_error","status_checked_at":"2026-03-12T00:40:08.439Z","response_time":84,"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":["bulma","form-builder","form-handling","form-validation","forms-generator","php-form","php-form-builder","php-forms"],"created_at":"2025-06-15T01:00:16.539Z","updated_at":"2026-03-12T01:02:04.916Z","avatar_url":"https://github.com/mintyphp.png","language":"PHP","readme":"# MintyPHP Forms\n\nMintyPHP Forms is a powerful PHP form builder that enables you to create and validate forms without having to write a lot of boilerplate code.\n\n## Features\n\n- Bulma renderer, easily creating good looking forms\n- Validation rules, such as validating email, string length and numeric comparisons\n- Support checkbox arrays and multi selects\n- Best practices: follows best practices, well-tested, object oriented code\n- Extensible: create support for your favorite framework or form rendering style\n\n## Installation\n\nRun the following command to install MintyPHP Forms with Composer.\n\n```bash\ncomposer require mintyphp/forms\n```\n\nThe package has no dependencies on other packages.\n\n## Quick Start\n\nAdd the following to alias the most used classes in your PHP file:\n\n```php\nuse MintyPHP\\Form\\Elements as E;\nuse MintyPHP\\Form\\Validator\\Validators as V;\n```\n\nNow ensure all classes are (auto)loaded:\n\n```php\nrequire_once 'vendor/autoload.php';\n```\n\nAnd create a simple login form using:\n\n```php\n$form = E::form([\n    E::field(E::text('username'),E::label('Username'),[V::required('Username is required')]),\n    E::field(E::password('password'),E::label('Password')),\n    E::field(E::submit('Login')),\n]);\n```\n\nNow render the form using:\n\n```php\n$form-\u003erender();\n```\n\nAnd the output is:\n\n```html \n\u003cform method=\"post\"\u003e\n  \u003cdiv\u003e\n    \u003clabel for=\"username\"\u003eUsername\u003c/label\u003e\n    \u003cinput id=\"username\" type=\"text\" name=\"username\" value=\"\"/\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n    \u003clabel for=\"password\"\u003ePassword\u003c/label\u003e\n    \u003cinput id=\"password\" type=\"password\" name=\"password\" value=\"\"/\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n    \u003cinput type=\"submit\" value=\"Login\"/\u003e\n  \u003c/div\u003e\n\u003c/form\u003e\n```\n\nEasy as that.\n\n## Frontend frameworks\n\nMintyPHP Forms has support for the Bulma framework right out of the box. \nJust tell MintyPHP Forms that you want to use Bulmas style forms using:\n\n```php\nE::$style = 'bulma';\n// create and render the login form\n$form = E::form([\n    E::field(E::text('username')-\u003erequired(), E::label('Username')),\n    E::field(E::password('password'), E::label('Password')),\n    E::field(E::submit('Login')),\n]);\n$form-\u003erender();\n```\n\nAnd the output will be form in the familiar Bulma style:\n\n```html \n\u003cform method=\"post\"\u003e\n  \u003cdiv class=\"field\"\u003e\n    \u003clabel class=\"label\" for=\"username\"\u003eUsername\u003c/label\u003e\n    \u003cdiv class=\"control\"\u003e\n      \u003cinput id=\"username\" class=\"input\" type=\"text\" name=\"username\" value=\"\" required=\"required\"/\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"field\"\u003e\n    \u003clabel class=\"label\" for=\"password\"\u003ePassword\u003c/label\u003e\n    \u003cdiv class=\"control\"\u003e\n      \u003cinput id=\"password\" class=\"input\" type=\"password\" name=\"password\" value=\"\"/\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"field\"\u003e\n    \u003cdiv class=\"control\"\u003e\n      \u003cinput class=\"button is-primary\" type=\"submit\" value=\"Login\"/\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/form\u003e\n```\n\nIn the future we will add support for other frameworks, such as bootstrap 5.\n\n## Backend frameworks\n\nThis package has been tested with the MintyPHP backend framework. It can also be used with other frameworks as this package has no dependencies at all.\n\nAlthough we don't recommend you to use MintyPHP Forms without a backend (or frontend) framework, it is certainly possible, see the full example.\n\n## Full example\n\nThe Form object has the following data methods:\n\n- **fill**: Fill the form with an array of data (e.g. $_POST)\n- **validate**: Validate the form and add errors where needed\n- **addErrors**: Add custom errors (after validation)\n- **extract**: Extract the filled in form values\n- **render**: Output the form with or without root element\n\nThese data methods are typically used on GET:\n\n- GET:\n  - fill (with default values or from database)\n  - render\n- POST: \n  - fill (from POST data)\n  - validate\n    - on success: extract\n    - on errors: render\n\nYou can see how these are used in the following full example:\n\n[Full example - PHP code - Click here](example.php)\n\nAfter filling in a password and clicking \"Login\" it renders as:\n\n![example.png](example.png)\n\nInterested? Read the rest of the [documentation](docs/overview.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintyphp%2Fforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmintyphp%2Fforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintyphp%2Fforms/lists"}