X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom.pm;h=26ad101dbefc5a17514ba4c91b66cb4a39c9a3e4;hb=ac4c037eb84352eeaa41f793c9ad9568b6342689;hp=596b8621d91441097370da303a22da883cce7e39;hpb=5fa3d10f24e0a9aeaa77e5c7b1a22e6339959dd6;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom.pm b/lib/HTML/Zoom.pm index 596b862..26ad101 100644 --- a/lib/HTML/Zoom.pm +++ b/lib/HTML/Zoom.pm @@ -213,13 +213,14 @@ HTML::Zoom - selector based streaming template engine $_->select('.name')->replace_content('Matt') ->select('.age')->replace_content('26') }, + # alternate form sub { - $_->select('.name')->replace_content('Mark') - ->select('.age')->replace_content('0x29') + $_->replace_content({'.name' => ['Mark'],'.age' => ['0x29'] }) }, + #alternate alternate form sub { - $_->select('.name')->replace_content('Epitaph') - ->select('.age')->replace_content('') + $_->replace_content('.name' => 'Epitaph') + ->replace_content('.age' => '') }, ], { repeat_between => '.between' } @@ -342,14 +343,12 @@ cleanly: ->add_to_attribute( for => $field->{id} ) ->then ->replace_content( $field->{label} ) - - ->select('input') - ->add_to_attribute( name => $field->{name} ) - ->then - ->add_to_attribute( type => $field->{type} ) - ->then - ->add_to_attribute( value => $field->{value} ) - + ->add_to_attribute( + input => { + name => $field->{name}, + type => $field->{type}, + value => $field->{value} + }) } } @fields ]);