initial import of catalyst.
[catagits/Catalyst-Runtime.git] / README
CommitLineData
fc7ec1d9 1NAME
2 Catalyst - The Elegant MVC Web Application Framework
3
4SYNOPSIS
5 # use the helper to start a new application
6 catalyst MyApp
7 cd MyApp
8
9 # add models, views, controllers
10 bin/create model Something
11 bin/create view Stuff
12 bin/create controller Yada
13
14 # built in testserver
15 bin/server
16
17 # command line interface
18 bin/test /yada
19
20 See also L<Catalyst::Manual::Intro>
21
22 use Catalyst;
23
24 use Catalyst qw/My::Module My::OtherModule/;
25
26 use Catalyst '-Debug';
27
28 use Catalyst qw/-Debug -Engine=CGI/;
29
30 __PACKAGE__->action( '!default' => sub { $_[1]->res->output('Hello') } );
31
32 __PACKAGE__->action(
33 'index.html' => sub {
34 my ( $self, $c ) = @_;
35 $c->res->output('Hello');
36 $c->forward('_foo');
37 }
38 );
39
40 __PACKAGE__->action(
41 '/^product[_]*(\d*).html$/' => sub {
42 my ( $self, $c ) = @_;
43 $c->stash->{template} = 'product.tt';
44 $c->stash->{product} = $c->req->snippets->[0];
45 }
46 );
47
48DESCRIPTION
49 Catalyst is based upon Maypole, which you should consider for smaller
50 projects.
51
52 The key concept of Catalyst is DRY (Don't Repeat Yourself).
53
54 See Catalyst::Manual for more documentation.
55
56 Omit the Catalyst::Plugin:: prefix from plugins. So
57 Catalyst::Plugin::My::Module becomes My::Module.
58
59 use Catalyst 'My::Module';
60
61 You can also set special flags like -Debug and -Engine.
62
63 use Catalyst qw/-Debug My::Module/;
64
65 The position of plugins and flags in the chain is important, because
66 they are loaded in the same order they appear.
67
68 -Debug
69 use Catalyst '-Debug';
70
71 is equivalent to
72
73 use Catalyst;
74 sub debug { 1 }
75
76 -Engine
77 Force Catalyst to use a specific engine. Omit the Catalyst::Engine::
78 prefix.
79
80 use Catalyst '-Engine=CGI';
81
82 METHODS
83 debug
84 Overload to enable debug messages.
85
86 config
87 Returns a hashref containing your applications settings.
88
89SEE ALSO
90 Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response,
91 Catalyst::Engine
92
93AUTHOR
94 Sebastian Riedel, "sri@oook.de"
95
96THANK YOU
97 David Naughton, Gary Ashton Jones, Marcus Ramberg and all the others
98 who've helped.
99
100LICENSE
101 This library is free software . You can redistribute it and/or modify it
102 under the same terms as perl itself.
103