[dokuwiki] Re: Improvements in form handling for plugins

On Thu, 26 Jul 2007 17:29:34 -0400
"TNHarris" <telliamed@xxxxxxxxxxx> wrote:

> Ah, I had actually made that change but forgot to include it in the
> patch.
> Only thing is, empty() isn't well suited because it returns true for
> the string "0".
> Perhaps...?
>   foreach($params as $key => $val){
>     if($key{0} == '_' || ($skipempty && (is_null($val) || $val=='')))
>     continue;

Ah, yes. Makes sense,

> > I'd expect the following order:
> >   type, name, value, label, id, class, attrs
> 
> I see your point. Although with that order 'value' would be a required
> parameter since 'label' is. Or should it use the name when 'label' is
> empty? I think that'll work well.

Yes good idea.

> 'id' can default to empty and
> 'class' to either "simple" or "block"? (I think "block", it's used
> most often in inc/html.php.)

I'd leave it empty by default.

> (Is there much difference using "" versus null for default
> parameters?)

Not really, but I think an empty string is more intuitive. It's what I
would use to set "no class".
 
Andi

-- 
http://www.splitbrain.org
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: