handlebars-php icon indicating copy to clipboard operation
handlebars-php copied to clipboard

How many placeholder were substituted

Open obstschale opened this issue 9 months ago • 1 comments

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, we will render one template multiple times with different values provided. And we would like to show to the user, which placeholder were problematic, because of missing data.

Either handlebar-php keeps track of the substitutions and I can get statistics from it. Or I could get a list of all placeholder within the template, so I can check myself, which data is present before rendering.

obstschale avatar Sep 21 '23 15:09 obstschale