{"id":20253309,"url":"https://github.com/becklyn/orderedformbundle","last_synced_at":"2025-04-10T23:42:59.211Z","repository":{"id":29429124,"uuid":"121658033","full_name":"Becklyn/OrderedFormBundle","owner":"Becklyn","description":"This bundle adds functionality for ordering form elements","archived":false,"fork":false,"pushed_at":"2024-01-17T12:54:07.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"1.x","last_synced_at":"2025-04-10T23:42:51.670Z","etag":null,"topics":["forms","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"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/Becklyn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-15T17:20:08.000Z","updated_at":"2024-03-25T15:30:43.000Z","dependencies_parsed_at":"2024-01-17T15:01:29.786Z","dependency_job_id":null,"html_url":"https://github.com/Becklyn/OrderedFormBundle","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.3142857142857143,"last_synced_commit":"a66af3f46b1bed5e7b10edc1c1259918b1d536eb"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Becklyn%2FOrderedFormBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Becklyn%2FOrderedFormBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Becklyn%2FOrderedFormBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Becklyn%2FOrderedFormBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Becklyn","download_url":"https://codeload.github.com/Becklyn/OrderedFormBundle/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317726,"owners_count":21083527,"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":["forms","php","symfony","symfony-bundle"],"created_at":"2024-11-14T10:23:08.459Z","updated_at":"2025-04-10T23:42:59.192Z","avatar_url":"https://github.com/Becklyn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ordered Form Bundle\n===================\n\nA bundle that makes form fields sortable.\n\n\nInstallation\n------------\n\n```bash\ncomposer require becklyn/ordered-form-bundle\n```\n\n\nUsage\n-----\n\nThis bundle adds a new form option called `position`:\n\n```php\nuse Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\n\nclass SomeForm extends AbstractType\n{\n    /**\n     * @inheritDoc\n     */\n    public function buildForm (FormBuilderInterface $builder, array $options) : void\n    {\n        $builder\n            -\u003eadd(\"field\", null, [\n                \"position\" =\u003e /* some value */\n            ]);\n    }\n}\n```\n\nThe supported values are:\n\n| Value | Description |\n| ----- | ----------- |\n| `\"position\" =\u003e \"first\"` | Places the element as the first element in the form. |\n| `\"position\" =\u003e \"last\"` | Places the element as the last element in the form. |\n| `\"position\" =\u003e 42` | A simple sort order (the lower the number, the more at the top it is). Works with any integer. |\n| `\"position\" =\u003e [\"before\" =\u003e \"otherfield\"]` | Places the field before another one. |\n| `\"position\" =\u003e [\"after\" =\u003e \"otherfield\"]` | Places the field after another one. |\n\n\nCaveats\n-------\n\nThis bundle focuses on speed, so the sorting is not perfect. As it is pretty easy to create a conflicting, this bundle\ntries a best-effort sorting, but this implies:\n\n*   A `first` field isn't guaranteed to be the first one (eg. if there are multiple `first`).\n*   `before` and `after` only guarantee the relative order, not how big the distance is between these fields (it tries\n    to place them immediately next to each other).\n    \nIf the configuration of the form is sensible and conflict-free, then the order will work as expected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecklyn%2Forderedformbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbecklyn%2Forderedformbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecklyn%2Forderedformbundle/lists"}