my %config = (%{ $self->config || {} }, %{ $params });
$self->_clear_config;
- # FIXME - Is depending on the application name to pass into constructors here a good idea?
- # This makes app/ctx split harder I think.. Need to think more here, but I think
- # we want to pass the application in as a parameter when building the service
- # rather than depending on the app name, so that later, when the app becomes an instance
- # then it'll get passed in, and components can stash themselves 'per app instance'
- my $app_name = $self->param('application_name');
+ my $app_name = $self->param('application');
# Stash catalyst_component_name in the config here, so that custom COMPONENT
# methods also pass it.
default => sub { +{} },
);
+has application => (
+ is => 'ro',
+ isa => 'Catalyst|Str',
+ lazy => 1,
+ default => sub { shift->application_name },
+);
+
has application_name => (
is => 'ro',
isa => 'Str',
substitutions
file
driver
+ application
application_name
prefix
extensions
);
}
+sub build_application_service {
+ my $self = shift;
+
+ return Bread::Board::Literal->new(
+ name => 'application',
+ value => $self->application,
+ );
+}
+
sub build_application_name_service {
my $self = shift;
class => $component,
lifecycle => 'Singleton',
dependencies => [
- depends_on( '/application_name' ),
+ depends_on( '/application' ),
],
),
);