Updated Changes
[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
d01df17d 6 catalyst.pl MyApp
fc7ec1d9 7 cd MyApp
8
9 # add models, views, controllers
d01df17d 10 script/create.pl model Something
11 script/create.pl view Stuff
12 script/create.pl controller Yada
fc7ec1d9 13
14 # built in testserver
d01df17d 15 script/server.pl
fc7ec1d9 16
17 # command line interface
d01df17d 18 script/test.pl /yada
fc7ec1d9 19
fc7ec1d9 20 use Catalyst;
21
22 use Catalyst qw/My::Module My::OtherModule/;
23
24 use Catalyst '-Debug';
25
26 use Catalyst qw/-Debug -Engine=CGI/;
27
4be6aea7 28 sub default : Private { $_[1]->res->output('Hello') } );
29
30 sub index : Path('/index.html') {
31 my ( $self, $c ) = @_;
32 $c->res->output('Hello');
6f6e1bb4 33 $c->forward('foo');
4be6aea7 34 }
35
6f6e1bb4 36 sub product : Regex('^product[_]*(\d*).html$') {
4be6aea7 37 my ( $self, $c ) = @_;
38 $c->stash->{template} = 'product.tt';
39 $c->stash->{product} = $c->req->snippets->[0];
40 }
fc7ec1d9 41
92af75fc 42 See also Catalyst::Manual::Intro
43
fc7ec1d9 44DESCRIPTION
45 Catalyst is based upon Maypole, which you should consider for smaller
46 projects.
47
48 The key concept of Catalyst is DRY (Don't Repeat Yourself).
49
50 See Catalyst::Manual for more documentation.
51
4be6aea7 52 Catalyst plugins can be loaded by naming them as arguments to the "use
53 Catalyst" statement. Omit the "Catalyst::Plugin::" prefix from the
54 plugin name, so "Catalyst::Plugin::My::Module" becomes "My::Module".
fc7ec1d9 55
56 use Catalyst 'My::Module';
57
4be6aea7 58 Special flags like -Debug and -Engine can also be specifed as arguments
59 when Catalyst is loaded:
fc7ec1d9 60
61 use Catalyst qw/-Debug My::Module/;
62
63 The position of plugins and flags in the chain is important, because
4be6aea7 64 they are loaded in exactly the order that they appear.
fc7ec1d9 65
4be6aea7 66 The following flags are supported:
fc7ec1d9 67
4be6aea7 68 -Debug
69 enables debug output, i.e.:
fc7ec1d9 70
4be6aea7 71 use Catalyst '-Debug';
72
73 this is equivalent to:
74
75 use Catalyst;
76 sub debug { 1 }
fc7ec1d9 77
4be6aea7 78 -Engine
79 Force Catalyst to use a specific engine. Omit the
80 "Catalyst::Engine::" prefix of the engine name, i.e.:
fc7ec1d9 81
4be6aea7 82 use Catalyst '-Engine=CGI';
fc7ec1d9 83
4be6aea7 84METHODS
85 debug
86 Overload to enable debug messages.
fc7ec1d9 87
4be6aea7 88 config
89 Returns a hashref containing your applications settings.
90
91 $c->engine
92 Contains the engine class.
93
94 $c->log
95 Contains the logging object. Unless it is already set Catalyst sets
96 this up with a "Catalyst::Log" object. To use your own log class:
97
98 $c->log( MyLogger->new );
99 $c->log->info("now logging with my own logger!");
100
101 Your log class should implement the methods described in the
102 "Catalyst::Log" man page.
fc7ec1d9 103
6f6e1bb4 104 $c->plugin( $name, $class, @args )
105 Instant plugins for Catalyst. Classdata accessor/mutator will be
106 created, class loaded and instantiated.
107
108 MyApp->plugin( 'prototype', 'HTML::Prototype' );
109
110 $c->prototype->define_javascript_functions;
d1a31ac6 111
6f6e1bb4 112LIMITATIONS
113 mod_perl2 support is considered experimental and may contain bugs.
d1a31ac6 114
92af75fc 115SUPPORT
116 IRC:
117
118 Join #catalyst on irc.perl.org.
119
120 Mailing-Lists:
121
122 http://lists.rawmode.org/mailman/listinfo/catalyst
123 http://lists.rawmode.org/mailman/listinfo/catalyst-dev
4be6aea7 124
6f6e1bb4 125 Web:
126
127 http://catalyst.perl.org
128
fc7ec1d9 129SEE ALSO
4be6aea7 130 Catalyst::Manual - The Catalyst Manual
131 Catalyst::Engine - Core Engine
132 Catalyst::Log - The Log Class.
133 Catalyst::Request - The Request Object
134 Catalyst::Response - The Response Object
135 Catalyst::Test - The test suite.
fc7ec1d9 136
137AUTHOR
138 Sebastian Riedel, "sri@oook.de"
139
140THANK YOU
6f6e1bb4 141 Andy Grundman, Andrew Ford, Andrew Ruthven, Autrijus Tang, Christian
142 Hansen, Christopher Hicks, Dan Sully, Danijel Milicevic, David Naughton,
143 Gary Ashton Jones, Geoff Richards, Jesse Sheidlower, Jody Belka, Johan
144 Lindstrom, Juan Camacho, Leon Brocard, Marcus Ramberg, Tatsuhiko
145 Miyagawa and all the others who've helped.
fc7ec1d9 146
147LICENSE
148 This library is free software . You can redistribute it and/or modify it
149 under the same terms as perl itself.
150