8000 Allow comments within components / function calls · Issue #4001 · twigphp/Twig · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Allow comments within components / function calls #4001
Closed
@tacman

Description

@tacman

It is so natural to comment out HTML attributes that it's easy to think that Twig supports this. So easy that even the Symfony UX documentation has an example.

// ...

<div class="toggle-password-container"> // Add "toggle-password-container" or a class that applies position: relative to this container.
    <label for="password">Password</label>
    <input
        id="password"
        name="password"
        type="password"
        {{ stimulus_controller('symfony/ux-toggle-password/toggle-password', {
                {# visibleLabel: 'Show password', // If you want to modify this label. #}
                {# visibleIcon: 'Some svg icon', // If you want to modify this icon. #}
                {# hiddenLabel: 'Hide password', // If you want to modify this label. #}
                {# hiddenIcon: 'Some svg icon', // If you want to modify this icon. #}
                buttonClasses: ['toggle-password-button'], // Add as many classes as you wish. "toggle-password-button" is needed to activate the default CSS.
        }) }}
    >
</div>

// ...

https://symfony.com/bundles/ux-toggle-password/current/index.html#usage-without-symfony-forms

I started to make a PR to fix the docs, but it's not easy to decide where to move it. It'd be awesome if twig allowed this, as I frequently use it for in-line comments as well as disabling attri 5772 butes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0