{"id":20004159,"url":"https://github.com/fffunction/twig-static","last_synced_at":"2025-10-18T09:02:04.121Z","repository":{"id":62504320,"uuid":"96544216","full_name":"fffunction/twig-static","owner":"fffunction","description":"A filter that takes a static file path and returns a URL versioned with the file hash","archived":false,"fork":false,"pushed_at":"2017-07-10T09:55:23.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-12T13:29:04.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fffunction/twig-static","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/fffunction.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":"2017-07-07T14:03:34.000Z","updated_at":"2017-07-11T09:50:18.000Z","dependencies_parsed_at":"2022-11-02T12:30:36.395Z","dependency_job_id":null,"html_url":"https://github.com/fffunction/twig-static","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/fffunction%2Ftwig-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fffunction%2Ftwig-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fffunction%2Ftwig-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fffunction%2Ftwig-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fffunction","download_url":"https://codeload.github.com/fffunction/twig-static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241444037,"owners_count":19963748,"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-11-13T05:28:43.864Z","updated_at":"2025-10-18T09:01:59.082Z","avatar_url":"https://github.com/fffunction.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twig-static\n[![Build Status](https://travis-ci.org/fffunction/twig-static.svg?branch=master)](https://travis-ci.org/fffunction/twig-static)\n\n```\ncomposer require fffunction/twig-static\n```\n\n## Usage\n\nAdd the filter to Twig:\n```php\n$twig-\u003eaddFilter('static', new Twig_Filter_Function(\n    create_static_filter('path/to/assets/', '/url/to/prepend/')\n));\n```\n\nThen pass paths to the filter in your templates:\n```twig\n{{ 'js/app.bundle.js' | static }}\n{# /url/to/prepend/js/app.bundle.js?v=1a2b3c4 #}\n```\n\n## API\n\n`create_static_filter(sting $asset_root, string $asset_url): function`\n- `$asset_root`: a relative path from the app root to the assets root dir\n- `$asset_url`: a path to prepend to the returned url\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffffunction%2Ftwig-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffffunction%2Ftwig-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffffunction%2Ftwig-static/lists"}