Re: Re: Your opinion about QuickForm2 API

From: Date: Tue, 17 Apr 2007 03:36:41 +0000
Subject: Re: Re: Your opinion about QuickForm2 API
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-46263@lists.php.net to get a copy of this message
Stupid question - why not go with the second style as the default, across the board... $form->addElement('button', 'aButton', array('content' => 'Click me please')); $form->addElement('select', 'aSelect', array('options' => array('1' => 'option 1', '2' => 'option 2'))); ... but give the individual elements a bit of intelligence if you do happen to put in the wrong thing. You never publish this style in examples or tutorials, or endorse it - it's strictly a fallback. $form->addElement('button', 'aButton', 'Click me please')
if (!is_array($data)) {
    $data["content"] = $data;
} $form->addElement('select', 'aSelect', 1) if (!is_array($data)) { throw new Exception("Expected an array"); }
-- By a factor of three, what you do is not nearly as important as how it makes people feel; so why do you spend almost all your time on the wrong thing?

« previous php.pear.dev (#46263) next »