Merge pull request #355 from simonwelsh/patch-2

BUGFIX Don't filter out attributes that are '0'
This commit is contained in:
Sean Harvey 2012-04-19 17:47:18 -07:00
commit f1249e66a3

View File

@ -374,7 +374,9 @@ class FormField extends RequestHandler {
if(!$attrs || is_string($attrs)) $attrs = $this->getAttributes();
// Remove empty
$attrs = array_filter((array)$attrs, create_function('$v', 'return ($v || $v === 0);')); ;
$attrs = array_filter((array)$attrs, function($v) {
return ($v || $v === 0 || $v === '0');
});
// Remove excluded
if($exclude) $attrs = array_diff_key($attrs, array_flip($exclude));