widget documentation
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Data.pm
index 95da53c..39f3348 100644 (file)
@@ -11,3 +11,47 @@ before fragment widget {
 };
 
 1;
+
+__END__
+
+=head1 NAME
+
+Reaction::UI::Widget::Data - Abstract class to render a data hash reference
+
+=head1 DESCRIPTION
+
+This takes the C<args> method return value of the viewport and populates the
+arguments with names and values from that value.
+
+=head1 FRAGMENTS
+
+=head2 widget
+
+Sets an argument for every key and value in the viewport's C<args> method return
+value (which is expected to be a hash reference).
+
+=head1 EXAMPLE LAYOUT
+
+Assuming this hash reference:
+
+  { first_name => "Foo", last_name => "Bar" }
+
+we can access it in a layout set like this:
+
+  =widget Data
+  
+  =for layout widget
+  
+  Hello [% last_name | html %], [% first_name | html %]!
+  
+  =cut
+
+=head1 AUTHORS
+
+See L<Reaction::Class> for authors.
+
+=head1 LICENSE
+
+See L<Reaction::Class> for the license.
+
+=cut