HTML-Obj2HTML

 view release on metacpan or  search on metacpan

lib/HTML/Obj2HTML/Plugin/SemanticUIForms.pm  view on Meta::CPAN

  before => sub {
    my $obj = shift;
    if (ref $obj ne "HASH") { return ""; }

    my $readonly = HTML::Obj2HTML::get_opt("readonly") || $obj->{readonly};
    delete($obj->{readonly});
    if ($readonly) {
      return HTML::Obj2HTML::gen(commonfield($obj, [ span => $obj->{value} ] ));
    } else {
      return HTML::Obj2HTML::gen(commonfield($obj, [
          div => { class => "ui calendar ".$obj->{class}, _ => [
            div => { class => "ui input left icon", _ => [
              i => { class => "calendar icon", _ => [] },
              input => { type => "text", name => $obj->{name}, placeholder => $obj->{placeholder}, value => $obj->{value} }
            ]}
          ]}
      ]));
    }
  }
});



lib/HTML/Obj2HTML/Plugin/SemanticUIForms.pm  view on Meta::CPAN

  }
});
HTML::Obj2HTML::register_extension("dateinput", {
  tag => "",
  before => sub {
    my $obj = shift;

    if (ref $obj ne "HASH") { return ""; }

    return HTML::Obj2HTML::gen([
      div => { class => "ui calendar dateonly", _ => [
        div => { class => "ui input left icon", _ => [
          i => { class => "calendar icon", _ => [] },
          labeledinput => $obj
        ]}
      ]}
    ]);
  }
});

HTML::Obj2HTML::register_extension("hiddeninput", {
  tag => "input",
  attr => { type => "hidden" }



( run in 0.760 second using v1.01-cache-2.11-cpan-5dc5da66d9d )