X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom.pm;h=da858ad79b2302394c1048f9f75c376cf045915a;hb=5dbd334d1950339aea008c46b6d3b37945cd34a7;hp=8de1952c5e81c47286c5afd2621fae41ba6815fb;hpb=6dc05a36124ed607d23e19f2969ca5ab308bce5f;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom.pm b/lib/HTML/Zoom.pm index 8de1952..da858ad 100644 --- a/lib/HTML/Zoom.pm +++ b/lib/HTML/Zoom.pm @@ -8,7 +8,7 @@ use HTML::Zoom::Transform; use HTML::Zoom::TransformBuilder; use Scalar::Util (); -our $VERSION = '0.009006'; +our $VERSION = '0.009009'; $VERSION = eval $VERSION; @@ -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 ]);