Twig icon indicating copy to clipboard operation
Twig copied to clipboard

[html-extra] rename `html_classes()` to `html_attr()`

Open kbond opened this issue 1 year ago • 4 comments

This function can be used for any html attribute (ie data-action, data-controller).

kbond avatar Jan 23 '24 15:01 kbond

If acceptable, I'll update the docs.

kbond avatar Jan 23 '24 15:01 kbond

it can be used for attributes containing a space-separated list. That's not for any attribute out there. So html_attr is too generic for what it does (thus, using the same name than the html_attr escaping strategy can cause confusion)

stof avatar Jan 23 '24 16:01 stof

That's fair, maybe html_join or html_attr_join? But we'd have to configure the separator which I think would be hard (maybe not worth it).

kbond avatar Jan 23 '24 17:01 kbond

If we were to rename to function, html_attr_join sounds good to me.

fabpot avatar Feb 10 '24 08:02 fabpot

@kbond If you're ok with the new name, can you update this PR?

fabpot avatar Apr 29 '24 19:04 fabpot

I'm going to close this for now. I'm now feeling it's not worth the change.

kbond avatar Apr 30 '24 14:04 kbond