{"id":18496933,"url":"https://github.com/shapecode/twig-collector-extension","last_synced_at":"2025-05-14T04:36:31.449Z","repository":{"id":57048928,"uuid":"60514120","full_name":"shapecode/twig-collector-extension","owner":"shapecode","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-22T12:47:58.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T00:17:28.627Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shapecode.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":"2016-06-06T09:03:51.000Z","updated_at":"2021-04-22T22:27:48.000Z","dependencies_parsed_at":"2022-08-23T19:10:18.348Z","dependency_job_id":null,"html_url":"https://github.com/shapecode/twig-collector-extension","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapecode%2Ftwig-collector-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapecode%2Ftwig-collector-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapecode%2Ftwig-collector-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapecode%2Ftwig-collector-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shapecode","download_url":"https://codeload.github.com/shapecode/twig-collector-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254071503,"owners_count":22009802,"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-06T13:32:35.950Z","updated_at":"2025-05-14T04:36:31.379Z","avatar_url":"https://github.com/shapecode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shapecode - Twig Collector Extension\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e3c8e229-09ac-4ec7-94cb-5c6c18dd095f/mini.png)](https://insight.sensiolabs.com/projects/e3c8e229-09ac-4ec7-94cb-5c6c18dd095f)\n[![Latest Stable Version](https://poser.pugx.org/shapecode/twig-collector-extension/v/stable)](https://packagist.org/packages/shapecode/twig-collector-extension) \n[![Total Downloads](https://poser.pugx.org/shapecode/twig-collector-extension/downloads)](https://packagist.org/packages/shapecode/twig-collector-extension) \n[![Latest Unstable Version](https://poser.pugx.org/shapecode/twig-collector-extension/v/unstable)](https://packagist.org/packages/shapecode/twig-collector-extension) \n[![License](https://poser.pugx.org/shapecode/twig-collector-extension/license)](https://packagist.org/packages/shapecode/twig-collector-extension)\n\n## Install instructions\n\nVia Composer\n\n``` bash\n$ composer require shapecode/twig-collector-extension\n```\n\nAdd Extension to your Twig Environment\n\n``` php\n\u003c?php \n\nuse Twig\\Environment;\nuse Shapecode\\Twig\\Extensions\\Extension\\CollectorExtension;\n\n$twig = new Environment($loader);\n$twig-\u003eaddExtension(new CollectorExtension());\n```\n\n## Usage\n\ncollect stuff over all templates\n\n``` twig\n{% collector stylesheets %}\n\u003cstyle\u003e\n    .body {\n        margin-bottom: 10px;\n    }\n\u003c/style\u003e\n{% endcollector %}\n```\n\n... and output it at a specific line \n\n``` twig\n{% collection stylesheets %}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapecode%2Ftwig-collector-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshapecode%2Ftwig-collector-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapecode%2Ftwig-collector-extension/lists"}