symfony / stimulus-bridge

Stimulus integration bridge for Symfony projects
https://symfony.com/ux
75 stars 15 forks source link

Normalizing custom names "/" to "--" like normal controller names #72

Closed weaverryan closed 2 years ago

weaverryan commented 2 years ago

This was an oversight when I did #70. I believe we don't ever want / in the controller name. After this PR, if you set 'name': 'symfony/ux-typed', it will normalize to symfony--ux-typed. This is important because {{ stimulus_controller('symfony/ux-typed') already normalizes to symfony--ux-typed.

Cheers!

tgalopin commented 2 years ago

This is also extremely important because controller names are used in HTML attribute names: data-symfony--ux-typed-target. Using a / wouldn't work.

Thanks :) !