requires 'Catalyst::Plugin::I18N' => 0;
requires 'Catalyst::Model::DBIC::Schema' => 0;
requires 'Catalyst::View::TT' => '0.23';
-requires 'Catalyst::Controller::BindLex' => 0;
+requires 'Catalyst::Component::ACCEPT_CONTEXT' => 0;
requires 'Config::General' => 0;
requires 'Test::Class' => 0;
requires 'Test::Memory::Cycle' => 0;
sub exporter_for_package {
my ($self, $package) = @_;
my %exports_proto = $self->exports_for_package($package);
+ no warnings 'uninitialized'; # XXX fix this
my %exports = (
map { my $cr = $exports_proto{$_}; ($_, sub { Sub::Name::subname "${self}::$_" => $cr; }) }
keys %exports_proto
package Reaction::UI::Controller;
-use base qw/Catalyst::Controller::BindLex Reaction::Object/;
+use base qw(
+ Catalyst::Controller
+ Catalyst::Component::ACCEPT_CONTEXT
+ Reaction::Object
+);
+
use Reaction::Class;
sub push_viewport {
my $self = shift;
- my $focus_stack :Stashed;
+ my $c = $self->context;
+ my $focus_stack = $c->stash->{focus_stack};
my ($class, @proto_args) = @_;
my %args;
- my $c = Catalyst::Controller::BindLex::_get_c_obj(4);
if (my $vp_attr = $c->stack->[-1]->attributes->{ViewPort}) {
if (ref($vp_attr) eq 'ARRAY') {
$vp_attr = $vp_attr->[0];
}
sub pop_viewport {
- my $focus_stack :Stashed;
- return $focus_stack->pop_viewport;
+ return shift->context->stash->{focus_stack}->pop_viewport;
}
sub pop_viewports_to {
my ($self, $vp) = @_;
- my $focus_stack :Stashed;
- return $focus_stack->pop_viewports_to($vp);
+ return $self->context->stash->{focus_stack}->pop_viewports_to($vp);
}
sub redirect_to {
sub object :Chained('base') :PathPart('id') :CaptureArgs(1) {
my ($self, $c, $key) = @_;
- my $object :Stashed = $self->get_collection($c)->find($key);
+ my $object = $self->get_collection($c)->find($key);
confess "Object? what object?" unless $object; # should be a 404.
+ $c->stash(object => $object);
}
sub view :Chained('object') :Args(0) {
my ($self, $c) = @_;
- my $object :Stashed;
- $c->forward(basic_page => [{object => $object}]);
+ $c->forward(basic_page => [{object => $c->stash->{object}}]);
}
sub basic_page : Private {
sub begin :Private {
my ($self, $ctx) = @_;
- my $window :Stashed = Reaction::UI::Window->new(
- ctx => $ctx,
- view_name => $self->view_name,
- content_type => $self->content_type,
- title => $self->window_title,
- );
- my $focus_stack :Stashed = $window->focus_stack;
+ $ctx->stash(
+ window => Reaction::UI::Window->new(
+ ctx => $ctx,
+ view_name => $self->view_name,
+ content_type => $self->content_type,
+ title => $self->window_title,
+ )
+ );
+ $ctx->stash(focus_stack => $ctx->stash->{window}->focus_stack);
}
sub end :Private {
- my $window :Stashed;
- $window->flush;
+ my ($self, $ctx) = @_;
+ $ctx->stash->{window}->flush;
}
1;