Skip to content

PHP functions to add Stimulus JS attributes #737

Open
@19Gerhard85

Description

It would be nice to have functions or options to add Stimulus attributes on form widgets.

Something like

$builder->add('country', CountryType::class, [
    'attr' = stimulus_target('path/to/controller', 'targetName')
]);

or

$builder->add('country', CountryType::class, [
    'stimulus_target' = ['path/to/controller', 'targetName']
]);

Same goes for stimulus_action and stimulus_controller

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions