← Back to team overview

anewt-developers team mailing list archive

Re: [Branch ~sander-sinaasappel/anewt/anewt.new.cxs] Rev 1479: [form] Ids and extra attibutes for radio buttons and checkboxes

 

Wouter Bolsterlee wrote:
2009-07-21 klockan 10:42 skrev Sander van Schouwenburg:
Wouter Bolsterlee wrote:
I'm very interested in the use of extra_attributes. Seriously, what else do
you want besides CSS classes for styling or scripting?
onclick, onkeyup, onselect, onchange, etc.

Hmm, I always attach those from the outside from separate .js files (e.g.
using jQuery's .click() function). I don't like mixing behavioral code in
markup that is intended to be purely semantic.

My javascript isn't fluent enough to do it like that. Also, sometimes you want to generate it from php, because you need information from a database or something.

And internally they're changed to underscores anyway.

That's an implementation detail and irrelevant to this discussion... ;)

Well, actually it means it doesn't matter what you choose and is actually an argument FOR using dashes, because you can mix them.

What I actually meant to say was that I switched to using underscores BEFORE I knew they were internally changed anyway. Because I wanted to do $control->extra_attributes = $foo and don't want to be stuck always doing $control->set('extra-attributes', $foo).

But you can go ahead and change it. It doesn't break code.

-- Sander



References