How many placeholder were substituted

Open
#22 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
backend

Research direction

The issue body is the only entry point provided; begin by locating how handlebars-php performs placeholder substitution and applies default values, then inspect any existing rendering tests or public API. Done means callers can identify substituted placeholders or retrieve the placeholders present in a template so they can detect missing data before or after rendering.

Written by the indexing model from the issue text.

Description

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.

Dominant language
PHP
Stars
77
Forks
34
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from salesforce/handlebars-php

All issues in salesforce/handlebars-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.