{"id":23631174,"url":"https://github.com/philecms/philetwigfilters","last_synced_at":"2025-11-08T11:30:37.049Z","repository":{"id":11570271,"uuid":"14058157","full_name":"PhileCMS/phileTwigFilters","owner":"PhileCMS","description":"An example plugin showing how to make Twig filters.","archived":false,"fork":false,"pushed_at":"2018-03-29T15:41:23.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T02:48:49.473Z","etag":null,"topics":["philecms-plugin"],"latest_commit_sha":null,"homepage":null,"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/PhileCMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-11-02T01:21:58.000Z","updated_at":"2018-03-29T15:34:52.000Z","dependencies_parsed_at":"2022-07-13T10:10:30.708Z","dependency_job_id":null,"html_url":"https://github.com/PhileCMS/phileTwigFilters","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/PhileCMS%2FphileTwigFilters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileTwigFilters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileTwigFilters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileTwigFilters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhileCMS","download_url":"https://codeload.github.com/PhileCMS/phileTwigFilters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239551959,"owners_count":19657818,"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":["philecms-plugin"],"created_at":"2024-12-28T02:48:56.749Z","updated_at":"2025-11-08T11:30:36.850Z","avatar_url":"https://github.com/PhileCMS.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twig Functions\n\n[![Build Status](https://travis-ci.org/PhileCMS/phileTwigFilters.svg?branch=master)](https://travis-ci.org/PhileCMS/phileTwigFilters)\n\nAdds helpfull Twig functions to [Phile](https://github.com/PhileCMS/Phile) and easily allows you to create new ones. [Project home](https://github.com/PhileCMS/phileTwigFilters).\n\n## Installation\n\n```bash\ncomposer require phile/twig-functions\n```\n\n## Activation\n\n```php\n$config['plugins']['phile\\\\twigFunctions'] = [\n    'active' =\u003e true\n];\n```\n\n## Usage\n\nThis plugin includes some predefined Twig-filter and allows you to easily add your own.\n\n### Define a New Custom Filter\n\nSee the existing filters in config.php for how to add your own filter.\n\n### excerpt\n\nGrabs the first paragraph of the content string.\n\n```twig\n{{ content|excerpt }}\n```\n\n### limit_words\n\nSimilar to `excert` but limits on number of words. Use Twig's `striptags` to remove HTML-tags.\n\n```twig\n{{ page.content|striptags|limit_words }}\n```\n\n### shuffle\n\nShuffles an array. For example show a shuffled lists of pages:\n\n```twig\n\u003cul class=\"posts\"\u003e\n  {% for page in pages|shuffle %}\n    \u003cli\u003e\u003ca href=\"{{ page.url }}\"\u003e{{ page.title }}\u003c/a\u003e\u003c/li\u003e\n  {% endfor %}\n\u003c/ul\u003e\n```\n\n### slugify\n\nThis new Twig filter allows you to slugify a string. This is useful for making safe URLs, HTML-safe class/id names, or just cleaning up general strings.\n\n```twig\n\u003c!-- becomes \"this–is–an–strange–string\" --\u003e\n{{ \"This Is ____an STRÄNGE      string\" | slugify }}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilecms%2Fphiletwigfilters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilecms%2Fphiletwigfilters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilecms%2Fphiletwigfilters/lists"}