{"id":14966316,"url":"https://github.com/yiisoft/form","last_synced_at":"2025-04-13T07:50:17.710Z","repository":{"id":37825677,"uuid":"254740052","full_name":"yiisoft/form","owner":"yiisoft","description":"The package helps with implementing data entry forms","archived":false,"fork":false,"pushed_at":"2025-03-27T12:12:28.000Z","size":1167,"stargazers_count":46,"open_issues_count":3,"forks_count":19,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-10T22:30:16.665Z","etag":null,"topics":["form","forms","hacktoberfest","yii3"],"latest_commit_sha":null,"homepage":"https://www.yiiframework.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiisoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"yiisoft","github":["yiisoft"]}},"created_at":"2020-04-10T21:30:20.000Z","updated_at":"2025-03-29T17:29:28.000Z","dependencies_parsed_at":"2023-12-13T03:33:15.016Z","dependency_job_id":"36d5332e-e89d-4fc2-a239-5caa93bfcebf","html_url":"https://github.com/yiisoft/form","commit_stats":{"total_commits":269,"total_committers":27,"mean_commits":9.962962962962964,"dds":0.7137546468401488,"last_synced_commit":"d84e1200ad5478c6cc20581773b43a0c13d921d7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"yiisoft/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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","forms","hacktoberfest","yii3"],"created_at":"2024-09-24T13:36:12.554Z","updated_at":"2025-04-13T07:50:17.686Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","funding_links":["https://opencollective.com/yiisoft","https://github.com/sponsors/yiisoft"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yiisoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://yiisoft.github.io/docs/images/yii_logo.svg\" height=\"100px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eYii Form\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/form/v)](https://packagist.org/packages/yiisoft/form)\n[![Total Downloads](https://poser.pugx.org/yiisoft/form/downloads)](https://packagist.org/packages/yiisoft/form)\n[![Build status](https://github.com/yiisoft/form/actions/workflows/build.yml/badge.svg)](https://github.com/yiisoft/form/actions/workflows/build.yml)\n[![Code Coverage](https://codecov.io/gh/yiisoft/form/graph/badge.svg?token=7JVVOMMKCZ)](https://codecov.io/gh/yiisoft/form)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fform%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/form/master)\n[![static analysis](https://github.com/yiisoft/form/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/form/actions?query=workflow%3A%22static+analysis%22)\n[![type-coverage](https://shepherd.dev/github/yiisoft/form/coverage.svg)](https://shepherd.dev/github/yiisoft/form)\n[![psalm-level](https://shepherd.dev/github/yiisoft/form/level.svg)](https://shepherd.dev/github/yiisoft/form)\n\nThe package provides a set of widgets to help with dynamic server-side generation of HTML forms.\nThe following widgets are available out of the box:\n\n- input fields: `Checkbox`, `CheckboxList`, `Date`, `DateTimeLocal`, `Email`, `File`, `Hidden`, `Image`, \n  `Number`, `Password`, `RadioList`, `Range`, `Select`, `Telephone`, `Text`, `Textarea`, `Time`, `Url`;\n- buttons: `Button`, `ResetButton`, `SubmitButton`;\n- group widgets: `ButtonGroup`, `Fieldset`. \n- other: `ErrorSummary`.\n\nThese themes are available out of the box:\n\n- Bootstrap 5 Horizontal,\n- Bootstrap 5 Vertical.\n\n## Requirements\n\n- PHP 8.1 or higher.\n\n## Installation\n\nThe package could be installed with composer:\n\n```shell\ncomposer require yiisoft/form\n```\n\n## General usage\n\nConfigure themes (optional):\n\n```php\nuse Yiisoft\\Form\\ThemeContainer;\nuse Yiisoft\\Form\\ThemePath;\n\nThemeContainer::initialize(\n    config: [\n        'vertical' =\u003e require ThemePath::BOOTSTRAP5_VERTICAL,\n        'horizontal' =\u003e require ThemePath::BOOTSTRAP5_HORIZONTAL,\n    ],\n    defaultConfig: 'vertical',\n);\n```\n\n... and use `Field` helper to create widgets:\n\n```php\nuse Yiisoft\\Form\\PureField\\Field;\n\necho Field::text('firstName', theme: 'horizontal')-\u003elabel('First Name')-\u003eautofocus();\necho Field::text('lastName', theme: 'horizontal')-\u003elabel('Last Name');\necho Field::select('sex')-\u003elabel('Sex')-\u003eoptionsData(['m' =\u003e 'Male', 'f' =\u003e 'Female'])-\u003eprompt('—');\necho Field::number('age')-\u003elabel('Age')-\u003ehint('Please enter your age.');\necho Field::submitButton('Submit')-\u003ebuttonClass('primary');\n```\n\nThe result of executing the code above will be:\n\n```html\n\u003cdiv class=\"mb-3 row\"\u003e\n    \u003clabel class=\"col-sm-2 col-form-label\"\u003eFirst Name\u003c/label\u003e\n    \u003cdiv class=\"col-sm-10\"\u003e\n        \u003cinput type=\"text\" class=\"form-control\" name=\"firstName\" autofocus\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"mb-3 row\"\u003e\n    \u003clabel class=\"col-sm-2 col-form-label\"\u003eLast Name\u003c/label\u003e\n    \u003cdiv class=\"col-sm-10\"\u003e\n        \u003cinput type=\"text\" class=\"form-control\" name=\"lastName\"\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"mb-3\"\u003e\n    \u003clabel class=\"form-label\"\u003eSex\u003c/label\u003e\n    \u003cselect class=\"form-select\" name=\"sex\"\u003e\n        \u003coption value\u003e—\u003c/option\u003e\n        \u003coption value=\"m\"\u003eMale\u003c/option\u003e\n        \u003coption value=\"f\"\u003eFemale\u003c/option\u003e\n    \u003c/select\u003e\n\u003c/div\u003e\n\u003cdiv class=\"mb-3\"\u003e\n    \u003clabel class=\"form-label\"\u003eAge\u003c/label\u003e\n    \u003cinput type=\"number\" class=\"form-control\" name=\"age\"\u003e\n    \u003cdiv class=\"form-text\"\u003ePlease enter your age.\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"mb-3\"\u003e\n    \u003cbutton type=\"submit\" class=\"primary\"\u003eSubmit\u003c/button\u003e\n\u003c/div\u003e\n```\n\n## Documentation\n\n- [Guide](docs/guide/en/README.md)\n- [Internals](docs/internals.md)\n\nIf you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for\nthat. You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).\n\n## Support the project\n\n[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective\u0026logoColor=7eadf1\u0026labelColor=555555)](https://opencollective.com/yiisoft)\n\n## Follow updates\n\n[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)\n[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter\u0026logoColor=1DA1F2\u0026labelColor=555555?style=flat)](https://twitter.com/yiiframework)\n[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat\u0026logo=telegram)](https://t.me/yii3en)\n[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat\u0026logo=facebook\u0026logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)\n[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat\u0026logo=slack)](https://yiiframework.com/go/slack)\n\n## License\n\nThe Yii Form is free software. It is released under the terms of the BSD License.\nPlease see [`LICENSE`](./LICENSE.md) for more information.\n\nMaintained by [Yii Software](https://www.yiiframework.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fform/lists"}