diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-30 16:33:10 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-30 16:33:10 +0000 |
commit | 8a293e2eee23938229a7dbfb617faee579914dfc (patch) | |
tree | f1626e9facac38a6b323c92e7d31585e5902cbba /lib/Reaction/UI/RenderingContext | |
parent | 46937531eb2d28950b21c8b0982539e28b277b60 (diff) | |
download | reaction-8a293e2eee23938229a7dbfb617faee579914dfc.tar.gz reaction-8a293e2eee23938229a7dbfb617faee579914dfc.zip |
first cut of Reaction::UI::Skin and SiteLayout VP+widget
Diffstat (limited to 'lib/Reaction/UI/RenderingContext')
-rw-r--r-- | lib/Reaction/UI/RenderingContext/TT.pm | 45 |
1 files changed, 0 insertions, 45 deletions
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; |