https://bugzilla.wikimedia.org/show_bug.cgi?id=28313

--- Comment #4 from Happy-melon <[email protected]> 2011-04-11 
23:51:08 UTC ---
True, however now the syntax is getting rather dense and ugly, because the
options array is already several layers deep in the descriptor array.  What you
actually have is something like:

$formFields = array(
    'MyButton' => array(
        'type' => 'multiselect',
        'label' => 'Foo option:',
        'options' => array(
            array(
                'label' => 'message text',
                'val' => 'valuehere',
            ),
            array(
                'label' => 'other text',
                'val' => 'other value',
            ),
            array(
                'label' => 'other text', // same label
                'val' => 'yet another value',
            ),
            array(
                'label' => 'my optgroup',
                'val' => array(
                    'One' => 'choise1',
                    'Two' => 'choise2',
                ),
        ),
    ),
);

As opposed to:

$formFields = array(
    'MyButton' => array(
        'type' => 'multiselect',
        'label' => 'Foo option:',
        'options' => array(
            'message text' => 'valuehere',
            'other text' => 'other value',
            'my optgroup' => array(
                'One' => 'choise1',
                'Two' => 'choise2',
            ),
        ),
    ),
);

Which is significantly more compact, and arguably more readable too.  And
building those associative arrays from generators like
Language::getLanguageNames is not going to be particularly pretty, probably
with lots of foreach loops.

In a strongly typed language we'd have no difficulty making some sort of
structure for this.  With what we have, I'm not convinced that an associative
array is a good way to solve this.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to