From 8a293e2eee23938229a7dbfb617faee579914dfc Mon Sep 17 00:00:00 2001 From: matthewt Date: Wed, 30 Jan 2008 16:33:10 +0000 Subject: first cut of Reaction::UI::Skin and SiteLayout VP+widget --- lib/Reaction/UI/RenderingContext/TT.pm | 45 ---------------------------------- 1 file changed, 45 deletions(-) (limited to 'lib/Reaction/UI/RenderingContext') diff --git a/lib/Reaction/UI/RenderingContext/TT.pm b/lib/Reaction/UI/RenderingContext/TT.pm index 8308c0c..b359747 100644 --- a/lib/Reaction/UI/RenderingContext/TT.pm +++ b/lib/Reaction/UI/RenderingContext/TT.pm @@ -6,11 +6,6 @@ use aliased 'Template::View'; class TT is RenderingContext, which { - has 'iter_class' => ( - is => 'ro', required => 1, - default => sub { 'Reaction::UI::Renderer::TT::Iter'; }, - ); - our $body; implements 'dispatch' => as { @@ -67,45 +62,5 @@ class TT is RenderingContext, which { }; }; - -package Reaction::UI::Renderer::TT::Iter; - -use overload ( - q{""} => 'stringify', - fallback => 1 -); - -sub pos { shift->{pos} } - -sub new { - my ($class, $cr, $rctx) = @_; - bless({ rctx => $rctx, cr => $cr, pos => 0 }, $class); -} - -sub next { - my $self = shift; - $self->{pos}++; - my $next = $self->{cr}->(); - return unless $next; - return sub { $next->($self->{rctx}) }; -} - -sub all { - my $self = shift; - my @all; - while (my $e = $self->next) { - push(@all, $e); - } - \@all; -} - -sub stringify { - my $self = shift; - my $res = ''; - foreach my $e (@{$self->all}) { - $res .= $e->(); - } - $res; -} 1; -- cgit v1.2.3-54-g00ecf