From: Simon Elliott Date: Fri, 20 May 2011 21:56:58 +0000 (+0100) Subject: update docs X-Git-Tag: allocate~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=ac4c037eb84352eeaa41f793c9ad9568b6342689 update docs --- 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 ]); diff --git a/lib/HTML/Zoom/FilterBuilder.pm b/lib/HTML/Zoom/FilterBuilder.pm index 5c79584..fdfcb28 100644 --- a/lib/HTML/Zoom/FilterBuilder.pm +++ b/lib/HTML/Zoom/FilterBuilder.pm @@ -460,7 +460,7 @@ Sets an attribute of a given name to a given value for all matching selections. ->select('p') ->set_attribute(class=>'paragraph') ->select('div') - ->set_attribute({name=>'class', value=>'divider'}); + ->set_attribute({class=>'paragraph', name=>'divider'}); Overrides existing values, if such exist. When multiple L calls are made against the same or overlapping selection sets, the final