Skip to content

data-element should look at curly parameters #532

Description

@g105b

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNon-breaking improvements to existing behaviourgood first issueSuitable starting point for new contributors

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions