sub build_per_context_instance {
my ($self, $c, @args) = @_;
- my $newself = $self->new($self->_application, {%$self, context => $c, @args});
+ my $class = ref($self) || $self;
+ my $newself = $class->new($self->_application, {%$self, context => $c, @args});
return $newself;
}
};
sub _load_skin_config {
my ($self, $args) = @_;
+ my $class = ref($self) || $self;
my $base = $self->skin_dir;
my $lst = sub { (ref $_[0] eq 'ARRAY') ? $_[0] : [$_[0]] };
my @files = (
})}
);
if (my $super_name = $cfg{extends}) {
- my $super = $self->new(
+ my $super = $class->new(
name => $super_name,
view => $self->view,
skin_base_dir => $args->{skin_base_dir},