fix objects that evaulate to false. rafl
[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
f56990fa 10 script/myapp_create.pl model Something
11 script/myapp_create.pl view Stuff
12 script/myapp_create.pl controller Yada
fc7ec1d9 13
14 # built in testserver
f56990fa 15 script/myapp_server.pl
fc7ec1d9 16
17 # command line interface
f56990fa 18 script/myapp_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
fc7ec1d9 45 The key concept of Catalyst is DRY (Don't Repeat Yourself).
46
47 See Catalyst::Manual for more documentation.
48
4be6aea7 49 Catalyst plugins can be loaded by naming them as arguments to the "use
50 Catalyst" statement. Omit the "Catalyst::Plugin::" prefix from the
51 plugin name, so "Catalyst::Plugin::My::Module" becomes "My::Module".
fc7ec1d9 52
53 use Catalyst 'My::Module';
54
4be6aea7 55 Special flags like -Debug and -Engine can also be specifed as arguments
56 when Catalyst is loaded:
fc7ec1d9 57
58 use Catalyst qw/-Debug My::Module/;
59
60 The position of plugins and flags in the chain is important, because
4be6aea7 61 they are loaded in exactly the order that they appear.
fc7ec1d9 62
4be6aea7 63 The following flags are supported:
fc7ec1d9 64
4be6aea7 65 -Debug
66 enables debug output, i.e.:
fc7ec1d9 67
4be6aea7 68 use Catalyst '-Debug';
69
70 this is equivalent to:
71
72 use Catalyst;
73 sub debug { 1 }
fc7ec1d9 74
4be6aea7 75 -Engine
76 Force Catalyst to use a specific engine. Omit the
77 "Catalyst::Engine::" prefix of the engine name, i.e.:
fc7ec1d9 78
4be6aea7 79 use Catalyst '-Engine=CGI';
fc7ec1d9 80
4be6aea7 81METHODS
82 debug
83 Overload to enable debug messages.
fc7ec1d9 84
4be6aea7 85 config
86 Returns a hashref containing your applications settings.
87
88 $c->engine
89 Contains the engine class.
90
91 $c->log
92 Contains the logging object. Unless it is already set Catalyst sets
93 this up with a "Catalyst::Log" object. To use your own log class:
94
95 $c->log( MyLogger->new );
96 $c->log->info("now logging with my own logger!");
97
98 Your log class should implement the methods described in the
99 "Catalyst::Log" man page.
fc7ec1d9 100
6f6e1bb4 101 $c->plugin( $name, $class, @args )
102 Instant plugins for Catalyst. Classdata accessor/mutator will be
103 created, class loaded and instantiated.
104
105 MyApp->plugin( 'prototype', 'HTML::Prototype' );
106
107 $c->prototype->define_javascript_functions;
d1a31ac6 108
f56990fa 109CASE SENSITIVITY
110 By default Catalyst is not case sensitive, so "MyApp::C::FOO::Bar"
111 becomes "/foo/bar".
112
113 But you can activate case sensitivity with a config parameter.
114
115 MyApp->config->{case_sensitive} = 1;
116
6f6e1bb4 117LIMITATIONS
118 mod_perl2 support is considered experimental and may contain bugs.
d1a31ac6 119
92af75fc 120SUPPORT
121 IRC:
122
123 Join #catalyst on irc.perl.org.
124
125 Mailing-Lists:
126
127 http://lists.rawmode.org/mailman/listinfo/catalyst
128 http://lists.rawmode.org/mailman/listinfo/catalyst-dev
4be6aea7 129
6f6e1bb4 130 Web:
131
132 http://catalyst.perl.org
133
fc7ec1d9 134SEE ALSO
4be6aea7 135 Catalyst::Manual - The Catalyst Manual
136 Catalyst::Engine - Core Engine
137 Catalyst::Log - The Log Class.
138 Catalyst::Request - The Request Object
139 Catalyst::Response - The Response Object
140 Catalyst::Test - The test suite.
fc7ec1d9 141
142AUTHOR
143 Sebastian Riedel, "sri@oook.de"
144
145THANK YOU
6f6e1bb4 146 Andy Grundman, Andrew Ford, Andrew Ruthven, Autrijus Tang, Christian
147 Hansen, Christopher Hicks, Dan Sully, Danijel Milicevic, David Naughton,
148 Gary Ashton Jones, Geoff Richards, Jesse Sheidlower, Jody Belka, Johan
149 Lindstrom, Juan Camacho, Leon Brocard, Marcus Ramberg, Tatsuhiko
150 Miyagawa and all the others who've helped.
fc7ec1d9 151
152LICENSE
153 This library is free software . You can redistribute it and/or modify it
154 under the same terms as perl itself.
155