]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Presenter/MaterialComponents.pm
MaterialComponents: checkbox_tag
[mfinanz.git] / SL / Presenter / MaterialComponents.pm
index a4eacc8d3b69b59bc9e40e734cf4d53442a47332..6259fe4462d6f7a843476a1b2932ffc570ec25de 100644 (file)
@@ -285,6 +285,22 @@ sub select_tag {
   );
 }
 
+sub checkbox_tag {
+  my ($name, %attributes) = @_;
+
+  _set_id_attribute(\%attributes, $name);
+
+  my $label = $attributes{label}
+    ? html_tag('span', delete $attributes{label})
+    : '';
+
+  my $checkbox_html = SL::Presenter::Tag::checkbox_tag($name, %attributes);
+
+  html_tag('label',
+    $checkbox_html . $label,
+  );
+}
+
 
 1;
 __END__