{"id":36978191,"url":"https://github.com/smalldb/template-sloth","last_synced_at":"2026-01-13T22:47:39.394Z","repository":{"id":57053533,"uuid":"87579435","full_name":"smalldb/template-sloth","owner":"smalldb","description":"Slot-based template extension (this repository is a read-only mirror).","archived":false,"fork":false,"pushed_at":"2021-02-11T23:34:03.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-22T19:22:42.219Z","etag":null,"topics":["composition","regions","slot","slots","twig-extension"],"latest_commit_sha":null,"homepage":"https://smalldb.org/","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smalldb.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":"2017-04-07T19:19:47.000Z","updated_at":"2024-04-22T19:22:42.220Z","dependencies_parsed_at":"2022-08-24T06:00:19.956Z","dependency_job_id":null,"html_url":"https://github.com/smalldb/template-sloth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smalldb/template-sloth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smalldb%2Ftemplate-sloth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smalldb%2Ftemplate-sloth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smalldb%2Ftemplate-sloth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smalldb%2Ftemplate-sloth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smalldb","download_url":"https://codeload.github.com/smalldb/template-sloth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smalldb%2Ftemplate-sloth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28403322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["composition","regions","slot","slots","twig-extension"],"created_at":"2026-01-13T22:47:38.800Z","updated_at":"2026-01-13T22:47:39.388Z","avatar_url":"https://github.com/smalldb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Template Sloth\n==============\n\nSlot-based template extension.\n\nSee https://smalldb.org/template-sloth/\n\n...\n\n\nInstallation\n------------\n\nUsing Composer:\n\n`````\ncomposer require smalldb/template-sloth\n`````\n\nSymfony's `config.yml` — add `sloth` service, it will register into Twig\nautomatically:\n\n```.yaml\nservices:\n        sloth:\n                class: Smalldb\\TemplateSloth\\Sloth\n                arguments: [ '@twig' ]\n```\n\nTroubleshooting\n---------------\n\n\u003e Error: Unexpected \"slot\" tag (expecting closing tag for the \"…\" tag defined near line …) in …\n\nThis means the Sloth did not install the Twig extension. Is your dependency\ninjection container configured properly?\n\n\nUsage\n-----\n\n```.php\n$sloth = $this-\u003eget('sloth');\n$sloth-\u003esetLayout('layout.html.twig', [ 'user' =\u003e 'Alice']);\n$sloth-\u003eslot('content')-\u003eadd(10, 'template.html.twig', [ 'foo' =\u003e 'bar' ];\n$sloth-\u003eslot('content')-\u003eadd(20, 'template.html.twig', [ 'foo' =\u003e 'foo' ];\nreturn $sloth-\u003eresponse();\n```\n\n```.twig\n{% if 'content' is empty_slot %}\n  No content available.\n{% else %}\n  {% slot 'content' %}\n{% endif %}\n```\n\n\nDocumentation\n-------------\n\nSee https://smalldb.org/doc/template-sloth/master/\n\n\nLicense\n-------\n\nThe most of the code is published under Apache 2.0 license. See [LICENSE](Resources/doc/license.md) file for details.\n\n\nContribution guidelines\n-----------------------\n\nProject's primary repository is hosted at https://git.frozen-doe.net/smalldb/template-sloth,\nfeel free to submit issues there or create merge requests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmalldb%2Ftemplate-sloth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmalldb%2Ftemplate-sloth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmalldb%2Ftemplate-sloth/lists"}