Mercurial > pub > Impl
diff Lib/Form/Transform.pm @ 0:03e58a454b20
Создан репозитарий
author | Sergey |
---|---|
date | Tue, 14 Jul 2009 12:54:37 +0400 |
parents | |
children | 16ada169ca75 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/Form/Transform.pm Tue Jul 14 12:54:37 2009 +0400 @@ -0,0 +1,29 @@ +package Form::Transform; +use strict; +use warnings; +use base qw(IMPL::Transform); + +sub CTOR { + my ($this) = @_; + + $this->superCTOR( + Templates => { + 'Form::Container' => sub { my $this = shift; $this->TransformContainer(@_); }, + 'Form' => sub { my $this = shift; $this->TransformContainer(@_); } + }, + Default => \&TransformItem + ); +} + +sub TransformContainer { + my ($this,$container) = @_; +} + +sub TransformItem { + my ($this,$item) = @_; + return $item->isEmpty ? undef : $item->Value; +} + + + +1;