`data-element` should look at curly parameters
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 18
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
data-element marks an element as optional. It will be removed from the document if nothing is bound to it.
Docs: https://github.com/phpgt/DomTemplate/wiki/Conditional-and-optional-elements#data-element
I've just been adding the pagination of www.php.gt and I wanted to have a previous/next link. <a href="?page={{prevPage}} data-element>Previous page`
The data-element should remove the link if there is no previous page, but I had to add another data-bind parameter on it to trigger this functionality. <a href="?page={{prevPage}} data-element data-bind:data-prev="prevPage">Previous page`.
If something is bound via the curly braces, it should trigger the data-element functionality, just like it does already with data-bind attributes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of data-element and the existing handling for curly-brace parameters and data-bind attributes. Verify how an unbound parameter affects optional elements, then add coverage showing that an unbound {{prevPage}} removes the link while a bound value preserves it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100