with 'CatalystX::DynamicComponent' => {
name => '_setup_dynamic_controller',
+ pre_immutable_hook => '_setup_dynamic_controller_meta',
};
requires 'setup_components';
# like this is that I wrote the simple thing for the model
# code, abstracted _just_ enough to make it fly with this
# dirty hack, then stopped. EVERY TIME YOU DO THIS KITTENS DIE
- $meta->superclasses($app . '::ControllerBase'); # Wrong namespace, should be config
- # and we force it to do a role to
- # add our crap, allowing the user
- # to overlay functionality..
-
my $methods = $model->meta->get_method_map;
foreach my $method_name (keys %$methods) {
$controller->meta->add_method(
$meta->make_immutable;
}
+sub _setup_dynamic_controller_meta {
+ my ($app, $meta) = @_;
+ # Wrong namespace, should be config
+ # and we force it to do a role to
+ # add our crap, allowing the user
+ # to overlay functionality..
+ $meta->superclasses($app . '::ControllerBase', $meta->superclasses);
+}
+
sub generate_reflected_controller_action_method {
my ( $app, $model, $method ) = @_;
my $method_name = $method->name; # Is it worth passing the actual method object here?