- public static function label( $label, $id ) {
- return self::element( 'label', array( 'for' => $id ), $label );
+ public static function label( $label, $id, $attribs = array() ) {
+ $a = array( 'for' => $id );
+
+ # FIXME avoid copy pasting below:
+ if( isset( $attribs['class'] ) ){
+ $a['class'] = $attribs['class'];
+ }
+ if( isset( $attribs['title'] ) ){
+ $a['title'] = $attribs['title'];
+ }
+
+ return self::element( 'label', $a, $label );