class TT is RenderingContext, which {
- has 'tt_view' => ( is => 'ro', required => 1, isa => View);
-
has 'iter_class' => (
is => 'ro', required => 1,
default => sub { 'Reaction::UI::Renderer::TT::Iter'; },
);
implements 'render' => as {
- my ($self, $fname, $args) = @_;
+ my ($self, $lset, $fname, $args) = @_;
# foreach non-_ prefixed key in the args
# build a subref for this key that passes self so the generator has a
$tt_args->{content} = $iter;
$tt_args->{pos} = sub { $iter->pos };
}
- $self->tt_view->include($fname, $tt_args);
+ $lset->tt_view->include($fname, $tt_args);
};
};
implements 'widget_for' => as {
my ($self, $vp, $layout_set) = @_;
return $self->widget_class_for($layout_set)
- ->new(view => $self, viewport => $vp);
+ ->new(
+ view => $self, viewport => $vp, layout_set => $layout_set
+ );
};
implements 'widget_class_for' => as {
use Reaction::Class;
use aliased 'Reaction::UI::ViewPort';
use aliased 'Reaction::UI::View';
+use aliased 'Reaction::UI::LayoutSet';
class Widget which {
has 'viewport' => (isa => ViewPort, is => 'ro'); # required?
has 'view' => (isa => View, is => 'ro', required => 1);
+ has 'layout_set' => (isa => LayoutSet, is => 'ro', required => 1);
implements 'render' => as {
my ($self, $rctx) = @_;
@{$r_args}{@extra_keys} = map { $_->($self, $args); } @extra_gen;
$r_args->{'_'} = $content_gen->($self, $args);
#warn Dumper($r_args).' ';
- $rctx->render($fname, $r_args);
+ $rctx->render($self->layout_set, $fname, $r_args);
};
$class->meta->add_method($methname => $meth);