{"id":28252346,"url":"https://github.com/devtheorem/php-handlebars-parser","last_synced_at":"2026-02-25T03:06:15.721Z","repository":{"id":293303119,"uuid":"908263392","full_name":"devtheorem/php-handlebars-parser","owner":"devtheorem","description":"Parse Handlebars templates to a spec-compliant AST with PHP.","archived":false,"fork":false,"pushed_at":"2025-05-18T14:50:40.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-24T22:48:43.639Z","etag":null,"topics":["handlebars","parser","php"],"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/devtheorem.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-25T16:04:59.000Z","updated_at":"2025-05-18T14:50:44.000Z","dependencies_parsed_at":"2025-05-14T17:31:18.295Z","dependency_job_id":"aac07154-1fbe-4d53-b7a2-6a0e0ecbe6c2","html_url":"https://github.com/devtheorem/php-handlebars-parser","commit_stats":null,"previous_names":["devtheorem/php-handlebars-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devtheorem/php-handlebars-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtheorem%2Fphp-handlebars-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtheorem%2Fphp-handlebars-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtheorem%2Fphp-handlebars-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtheorem%2Fphp-handlebars-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devtheorem","download_url":"https://codeload.github.com/devtheorem/php-handlebars-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtheorem%2Fphp-handlebars-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260046048,"owners_count":22950797,"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":["handlebars","parser","php"],"created_at":"2025-05-19T16:15:29.335Z","updated_at":"2026-02-25T03:06:15.716Z","avatar_url":"https://github.com/devtheorem.png","language":"PHP","readme":"# PHP Handlebars Parser\n\nParse [Handlebars](https://handlebarsjs.com) templates to a spec-compliant AST with PHP.\n\nImplements the same lexical analysis and grammar specification as Handlebars.js, so any template\nwhich can (or cannot) be parsed by Handlebars.js should parse (or error) the same way here.\n\n\u003e [!NOTE]\n\u003e This project is only a parser. To compile Handlebars templates to native PHP for execution,\n\u003e see [PHP Handlebars](https://github.com/devtheorem/php-handlebars), which uses this parser.\n\n## Installation\n\n`composer require devtheorem/php-handlebars-parser`\n\n## Usage\n\n```php\nuse DevTheorem\\HandlebarsParser\\ParserFactory;\n\n$parser = (new ParserFactory())-\u003ecreate();\n\n$template = \"Hello {{name}}!\";\n\n$result = $parser-\u003eparse($template);\n```\n\nIf the template contains invalid syntax, an exception will be thrown.\nOtherwise, `$result` will contain a `DevTheorem\\HandlebarsParser\\Ast\\Program` instance.\n\n## Whitespace handling\n\nThe parser can be created with an optional boolean argument,\nto support the `ignoreStandalone` Handlebars compilation option:\n\n```php\n$parser = (new ParserFactory())-\u003ecreate(ignoreStandalone: true);\n```\n\n## Author\n\nTheodore Brown  \nhttps://theodorejb.me\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtheorem%2Fphp-handlebars-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevtheorem%2Fphp-handlebars-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtheorem%2Fphp-handlebars-parser/lists"}