aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/WidgetClass.pm
diff options
context:
space:
mode:
authormatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-08 00:21:01 +0000
committermatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-08 00:21:01 +0000
commita86de581e80ee37e60860bde8ddaa975ff7dd6c9 (patch)
treea0e3244407c8760a8527ed5025c980f663525f3d /lib/Reaction/UI/WidgetClass.pm
parentc0d494fbf4de3a6a9e14e120518cb52d8591577b (diff)
downloadreaction-a86de581e80ee37e60860bde8ddaa975ff7dd6c9.tar.gz
reaction-a86de581e80ee37e60860bde8ddaa975ff7dd6c9.zip
sketch of 'attrs' widget helper
Diffstat (limited to 'lib/Reaction/UI/WidgetClass.pm')
-rw-r--r--lib/Reaction/UI/WidgetClass.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Reaction/UI/WidgetClass.pm b/lib/Reaction/UI/WidgetClass.pm
index 7e7216c..22e00e6 100644
--- a/lib/Reaction/UI/WidgetClass.pm
+++ b/lib/Reaction/UI/WidgetClass.pm
@@ -78,6 +78,19 @@ override exports_for_package => sub {
my %args = map{ $vp->event_id_for($_) => $events->{$_} } keys %$events;
$vp->ctx->req->uri_with(\%args);
},
+ attrs => sub {
+ my ($attrs) = @_;
+ return join(' ', map {
+ my $text = $attrs->{$_};
+ for ($text) {
+ s/&/&amp;/g;
+ s/</&lt;/g;
+ s/>/&gt;/g;
+ s/"/&quot;/g;
+ }
+ qq{$_="${text}"};
+ } keys %$attrs);
+ },
);
};
override default_base => sub { ('Reaction::UI::Widget') };