aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-07-11 22:59:02 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-07-11 22:59:02 +0000
commit4ad1eed3fe0f8a90080c63ec474e4634376f0f95 (patch)
tree16415e2857b59d155b63b1c6b7ff8ba39be7a7da /lib/Reaction/UI
parentb5a45848e42a559b828c46167f98c507a3ac8fc3 (diff)
downloadreaction-4ad1eed3fe0f8a90080c63ec474e4634376f0f95.tar.gz
reaction-4ad1eed3fe0f8a90080c63ec474e4634376f0f95.zip
wire layout_args, which was somehow never connected to the mix
Diffstat (limited to 'lib/Reaction/UI')
-rw-r--r--lib/Reaction/UI/View.pm3
-rw-r--r--lib/Reaction/UI/ViewPort.pm10
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/Reaction/UI/View.pm b/lib/Reaction/UI/View.pm
index bdd04a2..f81929d 100644
--- a/lib/Reaction/UI/View.pm
+++ b/lib/Reaction/UI/View.pm
@@ -65,7 +65,8 @@ sub render_viewport_args {
my ($self, $vp) = @_;
my $layout_set = $self->layout_set_for($vp);
my $widget = $self->widget_for($vp, $layout_set);
- return ($widget, { viewport => $vp });
+ my %layout_args = (%{ $vp->layout_args }, viewport => $vp);
+ return ($widget, \%layout_args);
};
sub widget_for {
my ($self, $vp, $layout_set) = @_;
diff --git a/lib/Reaction/UI/ViewPort.pm b/lib/Reaction/UI/ViewPort.pm
index c86c793..ed9722e 100644
--- a/lib/Reaction/UI/ViewPort.pm
+++ b/lib/Reaction/UI/ViewPort.pm
@@ -250,6 +250,16 @@ The layout attribute can either be specifically passed when calling
C<push_viewport>, or it will be determined using the last part of the
ViewPorts classname.
+=item layout_args
+
+This read-only hashref attribute will pass all it's keys as variables to the
+layout at render time. They should be accessible from both the layout templates
+and the widget, if applicable, through the C<%_> hash.
+
+ $controller->push_viewport(VPName, layout => 'foo', layout_args => { bar => 'bar'});
+ $_{bar} #in widget
+ [% bar %] in template
+
=item column_order
This is generally used by more specialised ViewPorts such as the