Mercurial > pub > Impl
view Lib/Form/Transform.pm @ 103:c289ed9662ca
Schema beta 2
More strict validation, support for inflating a simple nodes and properties
| author | wizard | 
|---|---|
| date | Fri, 07 May 2010 18:17:40 +0400 | 
| parents | 16ada169ca75 | 
| children | 76515373dac0 | 
line wrap: on
 line source
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;
