1 package Reaction::UI::ViewPort::Action::Link;
5 class Link is 'Reaction::UI::ViewPort', which {
7 has label => (is => 'rw', required => 1);
8 has uri => ( is => 'rw', lazy_build => 1);
10 has target => (isa => 'Object', is => 'rw', required => 1);
11 has action => (isa => 'CodeRef', is => 'rw', required => 1);
13 implements BUILD => as{
15 $self->label( $self->label->($self->target) ) if ref $self->label eq 'CODE';
18 implements _build_uri => as{
21 my ($c_name, $a_name, @rest) = @{ $self->action->($self->target, $c) };
22 $c->uri_for($c->controller($c_name)->action_for($a_name),@rest);