{"id":24650742,"url":"https://github.com/tangoman75/twighelperbundle","last_synced_at":"2026-05-07T14:44:04.820Z","repository":{"id":57064988,"uuid":"103145325","full_name":"TangoMan75/TwigHelperBundle","owner":"TangoMan75","description":"TangoMan TwigHelper Bundle provides a collection of useful twig functions.","archived":false,"fork":false,"pushed_at":"2020-09-04T19:32:25.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T18:16:32.354Z","etag":null,"topics":[],"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/TangoMan75.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":null,"security":null,"support":null}},"created_at":"2017-09-11T14:20:51.000Z","updated_at":"2020-09-04T19:32:38.000Z","dependencies_parsed_at":"2022-08-24T07:50:09.957Z","dependency_job_id":null,"html_url":"https://github.com/TangoMan75/TwigHelperBundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2FTwigHelperBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2FTwigHelperBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2FTwigHelperBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2FTwigHelperBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TangoMan75","download_url":"https://codeload.github.com/TangoMan75/TwigHelperBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244686449,"owners_count":20493446,"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":"2025-01-25T18:16:34.608Z","updated_at":"2025-10-20T10:32:32.401Z","avatar_url":"https://github.com/TangoMan75.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TangoMan TwigHelper Bundle\n====================\n\n**TangoMan TwigHelper Bundle** provides a collection of useful twig functions.\n\nInstallation\n============\n\nStep 1: Download the Bundle\n---------------------------\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```bash\n$ composer require tangoman/twig-helper-bundle\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\nStep 2: Enable Bundle\n---------------------\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    // ...\n\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new TangoMan\\TwigHelperBundle\\TangoManTwigHelperBundle(),\n        );\n\n        // ...\n    }\n}\n```\n\nAvaillable functions\n====================\n\nstart_with\n----------\n\n(deprecated, since twig 3x handles this one just fine)\n\nChecks if at least one item from haystack starts with needle.\n\n```twig\n{% if start_with(app.request.attributes.get('_route'), item.pages ?? []) %}\n    {{ item }}\n{% endif %}\n```\n\nend_with\n--------\n\n(deprecated, since twig 3x handles this one just fine)\n\n\nChecks if at least one item from haystack ends with needle.\n\n```twig\n{% if end_with(app.request.attributes.get('_route'), ['index','list']) %}\n    {{ item }}\n{% endif %}\n```\n\nis_numeric\n----------\n\nFinds whether a variable is a number or a numeric string.\n\n```twig\n{% if is_numeric(item) %}\n    {{ item }}\n{% else %}\n    \"{{ item }}\"\n{% endif %}\n```\n\nis_string\n---------\n\nFind whether the type of a variable is string.\n\n```twig\n{% if is_string(user) %}\n    Welcome {{ user }} !\n{% else %}\n    Are you kidding me ? Is \"{{ user }}\" even a name ?\n{% endif %}\n```\n\nAvaillable filters\n==================\n\nto_array\n--------\n\nConverts stdObject or json string to traversable array.\n\n```twig\n{% for key, value in object|to_array %}\n    \u003ctd\u003e{{ key }}\u003c/td\u003e\n    \u003ctd\u003e{{ value }}\u003c/td\u003e\n{% endif %}\n```\n\nNote\n====\n\nIf you find any bug please report here : [Issues](https://github.com/TangoMan75/TwigHelperBundle/issues/new)\n\nLicense\n=======\n\nCopyright (c) 2020 Matthias Morin\n\n[![License][license-MIT]][license-url]\nDistributed under the MIT license.\n\nIf you like **TangoMan TwigHelper Bundle** please star!\nAnd follow me on GitHub: [TangoMan75](https://github.com/TangoMan75)\n... And check my other cool projects.\n\n[Matthias Morin | LinkedIn](https://www.linkedin.com/in/morinmatthias)\n\n[license-MIT]: https://img.shields.io/badge/Licence-MIT-green.svg\n[license-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangoman75%2Ftwighelperbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangoman75%2Ftwighelperbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangoman75%2Ftwighelperbundle/lists"}