{"id":20170755,"url":"https://github.com/pear/html_quickform2","last_synced_at":"2025-08-21T15:32:19.903Z","repository":{"id":2995830,"uuid":"4012574","full_name":"pear/HTML_QuickForm2","owner":"pear","description":"Provides methods to create, validate and render HTML forms in PHP.","archived":false,"fork":false,"pushed_at":"2023-11-02T12:11:25.000Z","size":1306,"stargazers_count":22,"open_issues_count":1,"forks_count":18,"subscribers_count":16,"default_branch":"trunk","last_synced_at":"2024-12-07T16:33:43.670Z","etag":null,"topics":["form","form-validation","javascript","php","quickform"],"latest_commit_sha":null,"homepage":"http://pear.php.net/package/HTML_QuickForm2","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pear.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-04-13T05:14:47.000Z","updated_at":"2024-08-07T11:23:57.000Z","dependencies_parsed_at":"2022-09-04T12:50:59.209Z","dependency_job_id":"197c01d8-30af-4302-be0f-20798455d9cf","html_url":"https://github.com/pear/HTML_QuickForm2","commit_stats":{"total_commits":417,"total_committers":5,"mean_commits":83.4,"dds":"0.16546762589928055","last_synced_commit":"9e1da1376c556a9b9833e720f98b146f8c4968a9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FHTML_QuickForm2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FHTML_QuickForm2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FHTML_QuickForm2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FHTML_QuickForm2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pear","download_url":"https://codeload.github.com/pear/HTML_QuickForm2/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230520393,"owners_count":18238948,"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":["form","form-validation","javascript","php","quickform"],"created_at":"2024-11-14T01:20:47.382Z","updated_at":"2025-08-21T15:32:19.890Z","avatar_url":"https://github.com/pear.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML_QuickForm2\n\n[![Build Status](https://github.com/pear/HTML_QuickForm2/actions/workflows/continuous-integration.yml/badge.svg?branch=trunk)](https://github.com/pear/HTML_QuickForm2/actions/workflows/continuous-integration.yml)\n[![Static Analysis](https://github.com/pear/HTML_QuickForm2/actions/workflows/static-analysis.yml/badge.svg?branch=trunk)](https://github.com/pear/HTML_QuickForm2/actions/workflows/static-analysis.yml)\n\nThis is a repository for [PEAR HTML_QuickForm2] package that has been migrated from [PEAR SVN].\n\nHTML_QuickForm2 provides methods to create, validate and render HTML forms. It is a PHP5 rewrite of [PEAR HTML_QuickForm]\nand related packages.\n\nFeatures:\n\n * Supports all form elements defined in HTML4, provides several custom elements. Support for HTML5 form elements is\n   planned.\n * Server-side and client-side validation, several common rules provided. Validation rules can be combined with\n   'and' and 'or' for complex validation scenarios. Client-side validation can be run on changing the form field and\n   on submitting the form.\n * Client-side validation and Javascript-backed elements use a small self-contained JS library, there is no\n   dependency on JS frameworks.\n * Multipage forms (tabbed forms and wizards) are possible.\n * Pluggable elements, rules, renderers and renderer plugins.\n\nPlease report issues via the [PEAR bug tracker] or [Github issues].\n\nPull requests are welcome.\n\n[PEAR HTML_QuickForm2]: https://pear.php.net/package/HTML_QuickForm2/\n[PEAR SVN]: https://svn.php.net/repository/pear/packages/HTML_QuickForm2\n[PEAR HTML_QuickForm]: https://pear.php.net/package/HTML_QuickForm/\n[PEAR bug tracker]: https://pear.php.net/bugs/search.php?cmd=display\u0026package_name[]=HTML_QuickForm2\n[Github issues]: https://github.com/pear/HTML_QuickForm2/issues\n\n## Installation\n\nThe package may be installed either with PEAR\n\n    $ pear install HTML_QuickForm2\n\nor with composer\n\n    $ composer require pear/html_quickform2\n\nSince release 2.1 composer installation relies completely on autoloading and does not contain `require_once` calls or \nuse `include-path` option.\n\n## Basic usage\n\n```PHP\nrequire_once 'HTML/QuickForm2.php'; // Only when installed with PEAR\n\n$form = new HTML_QuickForm2('tutorial');\n\n// Set defaults for the form elements\n$form-\u003eaddDataSource(new HTML_QuickForm2_DataSource_Array([\n    'name' =\u003e 'Joe User'\n]));\n\n// Add some elements to the form\n$fieldset = $form-\u003eaddElement('fieldset')-\u003esetLabel('QuickForm2 tutorial example');\n$name = $fieldset-\u003eaddElement('text', 'name', ['size' =\u003e 50, 'maxlength' =\u003e 255])\n                 -\u003esetLabel('Enter your name:');\n$fieldset-\u003eaddElement('submit', null, ['value' =\u003e 'Send!']);\n\n// Define filters and validation rules\n$name-\u003eaddFilter('trim');\n$name-\u003eaddRule('required', 'Please enter your name');\n\n// Try to validate a form\nif ($form-\u003evalidate()) {\n    echo '\u003ch1\u003eHello, ' . htmlspecialchars($name-\u003egetValue()) . '!\u003c/h1\u003e';\n    exit;\n}\n\n// Output the form\necho $form;\n```\n\nAdditional examples are in the docs/examples directory.\n\n## Documentation\n\n...is available on PEAR website\n\n * [Tutorial](http://pear.php.net/manual/en/package.html.html-quickform2.tutorial.php)\n * [Migration from HTML_QuickForm](http://pear.php.net/manual/en/package.html.html-quickform2.qf-migration.php) and\n   [HTML_QuickForm_Controller](http://pear.php.net/manual/en/package.html.html-quickform2.controller-migration.php)\n * [Form elements](http://pear.php.net/manual/en/package.html.html-quickform2.elements.php) overview\n * [Elements' values and validation](http://pear.php.net/manual/en/package.html.html-quickform2.values.php)\n * [Form output customization and Javascript support](http://pear.php.net/manual/en/package.html.html-quickform2.output.php)\n * [Multipage forms](http://pear.php.net/manual/en/package.html.html-quickform2.multipage.php)\n\n[Generated API documentation](http://pear.php.net/package/HTML_QuickForm2/docs/latest/) for the current release is also there.\n\n## Testing, Packaging and Installing (Pear)\n\nTo test, run\n\n    $ phpunit tests/\n\nafter installing dependencies with composer. You can also test the installed package with\n\n    $ phpunit [PEAR tests dir]/HTML_QuickForm2\n\nSince PEAR package needs its `require_once` statements re-enabled, please run the helper file before packaging and\ninstalling\n\n    $ php pear-package-helper.php\n\nThen to build, simply\n\n    $ pear package .pear-package/package.xml\n\nTo install from scratch\n\n    $ pear install .pear-package/package.xml\n\nTo upgrade\n\n    $ pear upgrade -f .pear-package/package.xml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpear%2Fhtml_quickform2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpear%2Fhtml_quickform2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpear%2Fhtml_quickform2/lists"}