1 package Reaction::UI::Widget::Data;
3 use Reaction::UI::WidgetClass;
4 use namespace::clean -except => [qw(meta)];
6 extends 'Reaction::UI::Widget::Container';
8 before fragment widget {
9 my $data = $_{viewport}->args;
10 arg $_ => $data->{$_} for keys %$data;
19 Reaction::UI::Widget::Data - Abstract class to render a data hash reference
23 This takes the C<args> method return value of the viewport and populates the
24 arguments with names and values from that value.
30 Sets an argument for every key and value in the viewport's C<args> method return
31 value (which is expected to be a hash reference).
35 Assuming this hash reference:
37 { first_name => "Foo", last_name => "Bar" }
39 we can access it in a layout set like this:
45 Hello [% last_name | html %], [% first_name | html %]!
51 See L<Reaction::Class> for authors.
55 See L<Reaction::Class> for the license.