Support sub-expressions

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
handlebars, php
Domain
backend

Research direction

Start by tracing how Handlebars expressions and helpers are parsed and rendered; the issue does not identify a file, test, or entry point. Use the linked sub-expression documentation and the provided equality-helper example to define the intended behavior, then add coverage showing nested helper expressions work inside an if helper.

Written by the indexing model from the issue text.

Description

sub-expressions are very useful. They are supported by handlebars -> https://handlebarsjs.com/guide/expressions.html#subexpressions

image

For example, to use a "equality helper" in an "if helper"

{{#if (eq var1 var2)}}
  they are equal!
{{else}}
  they are not equal!
{{/if}}

I can try to help, but I am not really sure which piece of code to start with, as this is quite a generic request. It does not seem as if there is one part that "renders" the contents of the inside of a bracket, and one would have to do it oneself, per helper.

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.