improvements to MatchingPassword to have a better layout, label, and error messages...
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / File.pm
1 package Reaction::UI::ViewPort::Field::File;
2
3 use Reaction::Class;
4 use Reaction::Types::File;
5
6 class File is 'Reaction::UI::ViewPort::Field', which {
7
8   has '+value' => (isa => Reaction::Types::File::File());
9
10   has uri    => ( is => 'rw', lazy_build => 1);
11
12   has action => (isa => 'CodeRef', is => 'rw', required   => 1);
13
14   implements _build_uri => as{
15     my $self = shift;
16     my $c = $self->ctx;
17     my ($c_name, $a_name, @rest) = @{ $self->action->($self->model, $c) };
18     $c->uri_for($c->controller($c_name)->action_for($a_name),@rest);
19   };
20
21   implements _value_string_from_value => as {
22       shift->value->stringify;
23   };
24     
25 };
26
27 1;