Re: [Phphtmllib-devel] Usability issues
Status: Beta
Brought to you by:
hemna
|
From: Tim M. <mo...@mr...> - 2002-06-06 18:49:54
|
Walter A. Boring IV wrote:
> [...]
>
> new SPANtag(array(), "foo", "bar", "blah blah");
>
> This also has an issue. The current API of the libs is that the
> constructor of the html tag's 3rd param is a flag to set the
> newline after opentag flag. This was done to help collapse the
> content of a tag on the same line as the tag. But with 2.0.0 there
> is a new method called set_collapse() which will collapse the tag's
> content onto the same line (even nested objects as content).
>
> So do we break the API for 2.0 ? How many folks are actually using
> the 3rd param to the constructor?
I know that I don't use the third parameter.
I'm for improving the API and usability. If you are going to change
the API, the best time is at a major version (1.0.3 -> 2.0).
Another API change that I suggested before is switching the label and
value in the form_select() convenience function. It would allow calls
like this:
$form = form_select('example', ('zero', 'one', 'two'));
rather than this:
$form = form_select('example', (0=>'zero', 1=>'one', 2=>'two'));
The patch for this is simply:
--- phphtmllib.orig/tag_utils/form_utils.php Fri Apr 5 14:29:45 2002
+++ phphtmllib/tag_utils/form_utils.php Tue Apr 23 21:02:01 2002
@@ -294,7 +294,7 @@
$select = new SELECTtag( array("name" => $name) );
- while( list($label, $value) = each($options) ) {
+ while( list($value, $label) = each($options) ) {
$selected_value = "";
if ($value == $selected) {
$selected_value = "SELECTED";
On an unrelated note, can the mailing list be set up to have a
Reply-To header back to the list?
--
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road \ /
Sarasota, FL 34232 .________\(O)/________.
(941) 377-6775 x208 ' ' O(.)O ' '
|