3 class CatalystX::Declare::Keyword::Application
4 extends MooseX::Declare::Syntax::Keyword::Class {
7 override auto_make_immutable { 0 }
9 override add_with_option_customizations (Object $ctx, Str $package, ArrayRef $plugins, HashRef $options) {
11 $ctx->add_cleanup_code_parts(
13 '%s->setup(qw( %s ))',
21 before add_namespace_customizations (Object $ctx, Str $package) {
23 $ctx->add_preamble_code_parts(
25 'use parent q{Catalyst}',
32 CatalystX::Declare::Keyword::Application - Declare Catalyst Application Classes
36 use CatalystX::Declare;
38 application MyApp::Web
42 $CLASS->config(name => 'My App');
44 method debug_timestamp {
45 $self->log->debug('Timestamp: ' . time)
52 This module provides a keyword handler for the C<application> keyword. It is an
53 extension of L<MooseX::Declare/class>. The role application mechanism behind
54 the C<with> specification is hijacked and the arguments are passed to
55 Catalyst's C<setup> method. This hijacking is proably going away someday since
56 in the future plugins will be actual roles.
58 You don't have to call the C<setup> method yourself, this will be done by the
59 handler after the body has been run.
65 =item L<MooseX::Declare::Syntax::Keyword::Class>
71 =head2 auto_make_immutable
73 Bool Object->auto_make_immutable ()
75 A modified method that returns C<0> to signal to L<MooseX::Declare> that it
76 should not make this class immutable. Currently, making application classes
77 immutable isn't supported yet, therefore C<is mutable> is currently a no-op.
78 This will likely change as soon as application classes can be made immutable,
84 =item L<CatalystX::Declare>
86 =item L<MooseX::Declare/class>
88 =item L<MooseX::Declare::Syntax::Keyword::Class>
94 See L<CatalystX::Declare/AUTHOR> for author information.
98 This program is free software; you can redistribute it and/or modify it under
99 the same terms as perl itself.