Skip to content

devtheorem/php-handlebars-parser

Repository files navigation

PHP Handlebars Parser

Parse Handlebars templates to a spec-compliant AST with PHP.

Installation

composer require devtheorem/php-handlebars-parser

Usage

use DevTheorem\HandlebarsParser\ParserFactory;

$parser = (new ParserFactory())->create();

$template = "Hello {{name}}!";

$result = $parser->parse($template);

If the template contains invalid syntax, an exception will be thrown. Otherwise, $result will contain a DevTheorem\HandlebarsParser\Ast\Program instance.

Author

Theodore Brown

About

Parse Handlebars templates to a spec-compliant AST with PHP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published