{"id":17226782,"url":"https://github.com/dantleech/symfony-form-array-to-delimited-string-transformer","last_synced_at":"2025-04-14T01:13:11.326Z","repository":{"id":18492129,"uuid":"21687943","full_name":"dantleech/symfony-form-array-to-delimited-string-transformer","owner":"dantleech","description":"Symfony Form Data Transformer which transforms arrays to delimited strings and vice-versa","archived":false,"fork":false,"pushed_at":"2020-08-10T18:10:36.000Z","size":9,"stargazers_count":1,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T01:12:58.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dantleech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-10T09:08:00.000Z","updated_at":"2020-08-10T18:10:38.000Z","dependencies_parsed_at":"2022-07-26T23:01:54.455Z","dependency_job_id":null,"html_url":"https://github.com/dantleech/symfony-form-array-to-delimited-string-transformer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2Fsymfony-form-array-to-delimited-string-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2Fsymfony-form-array-to-delimited-string-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2Fsymfony-form-array-to-delimited-string-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dantleech%2Fsymfony-form-array-to-delimited-string-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dantleech","download_url":"https://codeload.github.com/dantleech/symfony-form-array-to-delimited-string-transformer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804825,"owners_count":21164135,"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":[],"created_at":"2024-10-15T04:17:14.137Z","updated_at":"2025-04-14T01:13:11.301Z","avatar_url":"https://github.com/dantleech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Array to delimited string data transformer\n==========================================\n\n[![Build Status](https://travis-ci.org/dantleech/symfony-form-array-to-delimited-string-transformer.svg)](https://travis-ci.org/dantleech/symfony-form-array-to-delimited-string-transformer)\n\nThis is a data transformer for the Symfony form framework.\n\nIt is meant for transforming text fields containing delimited strings to\narrays.\n\nUsage\n-----\n\nYou can use the data transformer as follows:\n\n````php\n$form-\u003eadd(\n    $builder-\u003ecreate('tags', 'text')-\u003eaddModelTransformer(\n        new ArrayToDelimitedStringTransformer()\n    )\n);\n````\n\nThis will transform the ``tags`` text field as follows:\n\n````php\n// Tranform\narray('one', 'two', 'three', 'four') === 'one, two, three, four'\n\n// Reverse transform\n'   one ,  two    , three, four,' === array('one', 'two', 'three', 'four')\n````\n\nChanging the delimiter\n----------------------\n\nYou can change the delimiting string with the first constructor argument:\n\n````php\nnew ArrayToDelimitedStringTransformer(';')\n````\n\nWill result in:\n\n````php\n// Transform\narray('one', 'two', 'three', 'four') === 'one; two; three; four'\n\n// Reverse Transform\n'one   ; two;three ;     four' =\u003e array('one', 'two', 'three')\n````\n\nOutput padding\n--------------\n\nAdditionally you can change the way in which the output is formatted with\nby setting the amount of whitespace (padding) before and after the text\nelements produced by a transformation:\n\n````php\nnew ArrayToDelimitedStringTransformer('%', 1, 1)\n````\n\nWill result in:\n\n````php\n// Transform\narray('one', 'two', 'three', 'four') === 'one % two % three % four'\n\n// Reverse Transform\n'one   % two%three %     four' =\u003e array('one', 'two', 'three')\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantleech%2Fsymfony-form-array-to-delimited-string-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantleech%2Fsymfony-form-array-to-delimited-string-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantleech%2Fsymfony-form-array-to-delimited-string-transformer/lists"}