. "\n"
. Xml::closeElement( 'select' );
if ( !is_null( $label ) ) {
- $ret = Xml::label( $label, $element_name ) . ' ' . $ret;
+ $ret = Xml::label( $label, $element_name ) . ' ' . $ret;
}
return $ret;
}
* @return string HTML
*/
public static function input( $name, $size=false, $value=false, $attribs=array() ) {
- $attributes = array();
+ $attributes = array( 'name' => $name );
+
if( $size ) {
$attributes['size'] = $size;
}
- if( $value ) {
+ if( $value !== false ) { // maybe 0
$attributes['value'] = $value;
}
- $attributes['name'] = $name;
-
return self::element( 'input', $attributes + $attribs );
}
*/
public static function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=array() ) {
list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs );
- return $label . ' ' . $input;
+ return $label . ' ' . $input;
}
/**
*/
public static function checkLabel( $label, $name, $id, $checked=false, $attribs=array() ) {
return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) .
- ' ' .
+ ' ' .
self::label( $label, $id, $attribs );
}
*/
public static function radioLabel( $label, $name, $value, $id, $checked=false, $attribs=array() ) {
return self::radio( $name, $value, $checked, array( 'id' => $id ) + $attribs ) .
- ' ' .
+ ' ' .
self::label( $label, $id, $attribs );
}