← Back to team overview

anewt-developers team mailing list archive

Re: Rev 1479: [form] Ids and extra attibutes for radio buttons and checkboxes

 

Hey,

[Nitpick alert!]

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.

>> (Btw, in any case the name should be extra-attributes --- with a dash, not
>> an underscore.)
> Since the __get, __set, __isset additions I've completely abandonned the  
> use of dashes, since you cannot do $control->extra-attributes = $attr.

As you might have noticed, I have a strong dislike for underscores except
for variable or method names... :)  That said, I designed it to be used like
this:

  $foo = $control->get('extra-attributes');
  $control->set('extra-attributes', $foo);

...or like this:

  $foo = $control->extra_attributes;
  $control->extra_attributes = $foo;

In other words: while "$control->extra-attributes" obviously won't work, you
can just access the value by using underscores in the member variable name.

(Fwiw, the dashes idea is taken from GLib that uses the same conventions for
property and signal names.)

> And internally they're changed to underscores anyway.

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

    — Wouter

Attachment: signature.asc
Description: Digital signature


Follow ups

References