}
sub redirect_to {
- my ($self, $c, $to, $cap, $args, $attrs) = @_;
+ my ($self, $c, $to, $cap, $args, $attrs, $domain) = @_;
#the confess calls could be changed later to $c->log ?
my $action;
$args ||= $c->req->args;
$attrs ||= {};
my $uri = $c->uri_for($action, $cap, @$args, $attrs);
+ $uri->host($domain) if $domain;
$c->res->redirect($uri);
}
my $uri = $proto->{uri} or confess('uri is required in prototype action');
my $label = exists $proto->{label} ? $proto->{label} : $proto_name;
my $layout = exists $proto->{layout} ? $proto->{layout} : 'uri';
- my $layout_args = exists $proto->{layout_args} ? $proto->{layout_args} : {};
my $action = Reaction::UI::ViewPort::URI->new(
location => join ('-', $loc, 'action', $i++),
uri => ( ref($uri) eq 'CODE' ? $uri->($target, $ctx) : $uri ),
display => ( ref($label) eq 'CODE' ? $label->($target, $ctx) : $label ),
- layout => ( ref($layout) eq 'CODE' ? $layout->($target, $ctx) : $layout ),
- layout_args => ( ref($layout_args) eq 'CODE' ? $layout_args->($target, $ctx) : $layout_args ),
+ layout => $layout,
+ exists $proto->{layout_args} ?
+ ( ref($proto->{layout_args}) eq 'CODE' ?
+ $proto->{layout_args}->($target, $ctx)
+ :
+ $proto->{layout_args} )
+ : ()
);
push(@act, $action);
}
=for layout option
- <option value="[% option_value %]" [% option_is_selected %]
- > [% option_name %]</option>
+ <option value="[% option_value %]" [% option_is_selected %]>[% option_name %]</option>
=for layout option_is_selected_yes