You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I found a solution: I have create a new Context class, which overrides the get-method. This allows me, to keep track of all used variables and it's values. That Wrapper-Context can return all placeholder and count statistics about their usage.
The only thing I need to figure out is, how to count how many default-values were used. I probably will also use Wrapper-Helper class and override the default Helper class.
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.
The text was updated successfully, but these errors were encountered: