Reaction::UI::ViewPort::InterfaceModel::Field::File - Reaction::UI::ViewPort::InterfaceModel::Field::File documentation


Reaction documentation Contained in the Reaction distribution.

Index


Code Index:

NAME

Top

Reaction::UI::ViewPort::Field::File

DESCRIPTION

Top

SEE ALSO

Top

Reaction::UI::ViewPort::Field

AUTHORS

Top

See Reaction::Class for authors.

LICENSE

Top

See Reaction::Class for the license.


Reaction documentation Contained in the Reaction distribution.

package Reaction::UI::ViewPort::InterfaceModel::Field::File;

use Reaction::Class;
use Reaction::Types::File;

use namespace::clean -except => [ qw(meta) ];
extends 'Reaction::UI::ViewPort::InterfaceModel::Field';



has '+value' => (isa => 'File', required => 0);

override apply_our_events => sub {
  my ($self, $ctx, $events) = @_;
  my $value_key = join(':', $self->location, 'value');
  if (my $upload = $ctx->req->upload($value_key)) {
    local $events->{$value_key} = $upload;
    return super();
  } else {
    return super();
  }
};

__PACKAGE__->meta->make_immutable;


1;