CatalystX-Declare
view release on metacpan or search on metacpan
lib/CatalystX/Declare.pm view on Meta::CPAN
}
final action special_welcome (Username $name) under base {
$ctx->response->body('Hugs to ' . $name);
}
}
See also:
L<CatalystX::Declare::Keyword::Role>,
L<CatalystX::Declare::Keyword::Action>,
L<MooseX::Declare/class>
=head2 Views
use CatalystX::Declare;
view MyApp::Web::View::TT
extends Catalyst::View::TT {
$CLASS->config(
TEMPLATE_EXTENSION => '.html',
);
}
See also:
L<CatalystX::Declare::Keyword::View>,
L<CatalystX::Declare::Keyword::Component>,
L<MooseX::Declare/class>
=head2 Models
use CatalystX::Declare;
model MyApp::Web::Model::DBIC::Schema
extends Catalyst::Model::DBIC::Schema {
$CLASS->config(
schema_class => 'MyApp::Schema',
);
}
See also:
L<CatalystX::Declare::Keyword::Model>,
L<CatalystX::Declare::Keyword::Component>,
L<MooseX::Declare/class>
=head1 DESCRIPTION
B<This module is EXPERIMENTAL>
This module provides a declarative syntax for L<Catalyst|Catalyst::Runtime>
applications. Its main focus is currently on common and repetitious parts of
the application, such as the application class itself, controllers, and
controller roles.
=head2 Not a Source Filter
The used syntax elements are not parsed via source filter mechanism, but
through L<Devel::Declare>, which is a much less fragile deal to handle and
allows extensions to mix without problems. For example, all keywords added
by this module are separete handlers.
=head2 Syntax Documentation
The documentation about syntax is in the respective parts of the distribution
below the C<CatalystX::Declare::Keyword::> namespace. Here are the manual
pages you will be interested in to familiarize yourself with this module's
syntax extensions:
=over
=item L<CatalystX::Declare::Keyword::Application>
=item L<CatalystX::Declare::Keyword::Action>
=item L<CatalystX::Declare::Keyword::Controller>
=item L<CatalystX::Declare::Keyword::Role>
=item L<CatalystX::Declare::Keyword::View>
=item L<CatalystX::Declare::Keyword::Model>
=back
Things like models, views, roles for request or response objects, can be built
declaratively with L<MooseX::Declare>, which is used to additionally provide
keywords for C<class>, C<role>, C<method> and the available method modifier
declarations. This allows for constructs such as:
use CatalystX::Declare;
class Foo {
method bar { 23 }
}
controller MyApp::Web::Controller::Baz {
final action qux under '/' {
$ctx->response->body(Foo->new->bar)
}
}
=head1 SEE ALSO
=head2 For Usage Information
These links are intended for the common user of this module.
=over
=item L<Catalyst::Runtime>
=item L<Catalyst::Devel>
=item L<Catalyst::Manual>
Although you probably already know Catalyst, since you otherwise probably
( run in 0.962 second using v1.01-cache-2.11-cpan-364913b4093 )