handlebars-php
handlebars-php copied to clipboard
A simple, logic-less, yet powerful templating engine for PHP
This PR introduces support for multiple or named parameters in partials. The implementation follows the handlebarjs behavior and documentation: https://handlebarsjs.com/guide/partials.html#partial-parameters
Avoid use of Null Coalescing Operator to support composer files: PHP >= 5.4
sub-expressions are very useful. They are supported by handlebars ->  For example, to use a "equality helper" in an "if helper" ```hbs {{#if (eq var1 var2)}} they are equal!...
When I have the following nested context: ``` [ 'person' => [ 'firstName' => 'Foo', 'lastName' => 'Bar', 'zip' => '12345' ] ] ``` and want to get variables from...
Is there a way to find out which variable/placeholder was substituted or a default value has been used? We need to calculate, which placeholder was actually used. In our example,...
Hi, I'd like to add custom helpers, but it seems to not support if there is no hash. I want something like {{log post}} for example, like in the [javascript...
I've created a custom helper that evaulates a conditional expression (similar to if with conditional expression) as below: ``` $this->handlebars->addHelper("compare", function($template, $context, $args, $source){ list($operandSpecName, $operator, $operand2) = explode(" ",$args);...
Hello, I cannot send data into partial template (ver. 2.3.0) `{{> partials/_head title="Header title" }}` Is it possible or Am I doing something wrong? Thank you