1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
129 .\" ========================================================================
131 .IX Title "Catalyst::Helper 3"
132 .TH Catalyst::Helper 3 "2009-12-06" "perl v5.8.7" "User Contributed Perl Documentation"
134 Catalyst::Helper \- Bootstrap a Catalyst application
136 .IX Header "SYNOPSIS"
138 \& catalyst.pl <myappname>
141 .IX Header "DESCRIPTION"
142 This module is used by \fBcatalyst.pl\fR to create a set of scripts for a
143 new catalyst application. The scripts each contain documentation and
144 will output help on how to use them if called incorrectly or in some
145 cases, with no arguments.
147 It also provides some useful methods for a Helper module to call when
148 creating a component. See \*(L"\s-1METHODS\s0\*(R".
152 .IX Subsection "_create.pl"
153 Used to create new components for a catalyst application at the
156 .IX Subsection "_server.pl"
157 The catalyst test server, starts an \s-1HTTPD\s0 which outputs debugging to
160 .IX Subsection "_test.pl"
161 A script for running tests from the command\-line.
163 .IX Subsection "_cgi.pl"
164 Run your application as a \s-1CGI\s0.
166 .IX Subsection "_fastcgi.pl"
167 Run the application as a fastcgi app. Either by hand, or call this
168 from FastCgiServer in your http server config.
171 The \*(L"_create.pl\*(R" script creates application components using Helper
172 modules. The Catalyst team provides a good number of Helper modules
173 for you to use. You can also add your own.
175 Helpers are classes that provide two methods.
178 \& * mk_compclass \- creates the Component class
179 \& * mk_comptest \- creates the Component test
182 So when you call \f(CW\*(C`scripts/myapp_create.pl view MyView TT\*(C'\fR, create
183 will try to execute Catalyst::Helper::View::TT\->mk_compclass and
184 Catalyst::Helper::View::TT\->mk_comptest.
186 See Catalyst::Helper::View::TT and
187 Catalyst::Helper::Model::DBIC::Schema for examples.
189 All helper classes should be under one of the following namespaces.
192 \& Catalyst::Helper::Model::
193 \& Catalyst::Helper::View::
194 \& Catalyst::Helper::Controller::
196 .Sh "\s-1COMMON\s0 \s-1HELPERS\s0"
197 .IX Subsection "COMMON HELPERS"
199 Catalyst::Helper::Model::DBIC::Schema \- DBIx::Class models
201 Catalyst::Helper::View::TT \- Template Toolkit view
203 Catalyst::Helper::Model::LDAP
205 Catalyst::Helper::Model::Adaptor \- wrap any class into a Catalyst model
208 .IX Subsection "NOTE"
210 The helpers will read author name from /etc/passwd by default.
211 To override, please export the \s-1AUTHOR\s0 variable.
215 .IX Subsection "mk_compclass"
216 This method in your Helper module is called with \f(CW$helper\fR
217 which is a Catalyst::Helper object, and whichever other arguments
218 the user added to the command\-line. You can use the \f(CW$helper\fR to call methods
221 If the Helper module does not contain a \f(CW\*(C`mk_compclass\*(C'\fR method, it
222 will fall back to calling \*(L"render_file\*(R", with an argument of
223 \&\f(CW\*(C`compclass\*(C'\fR.
225 .IX Subsection "mk_comptest"
226 This method in your Helper module is called with \f(CW$helper\fR
227 which is a Catalyst::Helper object, and whichever other arguments
228 the user added to the command\-line. You can use the \f(CW$helper\fR to call methods
231 If the Helper module does not contain a \f(CW\*(C`mk_compclass\*(C'\fR method, it
232 will fall back to calling \*(L"render_file\*(R", with an argument of
233 \&\f(CW\*(C`comptest\*(C'\fR.
235 .IX Subsection "mk_stuff"
236 This method is called if the user does not supply any of the usual
237 component types \f(CW\*(C`view\*(C'\fR, \f(CW\*(C`controller\*(C'\fR, \f(CW\*(C`model\*(C'\fR. It is passed the
238 \&\f(CW$helper\fR object (an instance of Catalyst::Helper), and any other
239 arguments the user typed.
241 There is no fallback for this method.
242 .SH "INTERNAL METHODS"
243 .IX Header "INTERNAL METHODS"
244 These are the methods that the Helper classes can call on the
245 <$helper> object passed to them.
246 .ie n .Sh "render_file ($file, $path\fP, \f(CW$vars)"
247 .el .Sh "render_file ($file, \f(CW$path\fP, \f(CW$vars\fP)"
248 .IX Subsection "render_file ($file, $path, $vars)"
249 Render and create a file from a template in \s-1DATA\s0 using Template
250 Toolkit. \f(CW$file\fR is the relevent chunk of the _\|_DATA_\|_ section, \f(CW$path\fR is
251 the path to the file and \f(CW$vars\fR is the hashref as expected by
253 .ie n .Sh "get_file ($class, $file)"
254 .el .Sh "get_file ($class, \f(CW$file\fP)"
255 .IX Subsection "get_file ($class, $file)"
256 Fetch file contents from the \s-1DATA\s0 section. This is used internally by
257 \&\*(L"render_file\*(R". \f(CW$class\fR is the name of the class to get the \s-1DATA\s0
258 section from. _\|_PACKAGE_\|_ or ( \fIcaller\fR\|(0) )[0] might be sensible
261 .IX Subsection "mk_app"
262 Create the main application skeleton. This is called by catalyst.pl.
263 .Sh "mk_component ($app)"
264 .IX Subsection "mk_component ($app)"
265 This method is called by create.pl to make new components
266 for your application.
268 .IX Subsection "mk_dir ($path)"
269 Surprisingly, this function makes a directory.
270 .ie n .Sh "mk_file ($file, $content)"
271 .el .Sh "mk_file ($file, \f(CW$content\fP)"
272 .IX Subsection "mk_file ($file, $content)"
273 Writes content to a file. Called by \*(L"render_file\*(R".
274 .Sh "next_test ($test_name)"
275 .IX Subsection "next_test ($test_name)"
276 Calculates the name of the next numbered test file and returns it.
277 Don't give the number or the .t suffix for the test name.
278 .Sh "get_sharedir_file"
279 .IX Subsection "get_sharedir_file"
280 Method for getting a file out of share/
281 .Sh "render_file_contents"
282 .IX Subsection "render_file_contents"
283 Process a Template::Toolkit template.
284 .Sh "render_sharedir_file"
285 .IX Subsection "render_sharedir_file"
286 Render a template/image file from our share directory
289 The helpers will read author name from /etc/passwd by default.
290 To override, please export the \s-1AUTHOR\s0 variable.
292 .IX Header "SEE ALSO"
293 Catalyst::Manual, Catalyst::Test, Catalyst::Request,
294 Catalyst::Response, Catalyst
297 Catalyst Contributors, see Catalyst.pm
300 This library is free software. You can redistribute it and/or modify
301 it under the same terms as Perl itself.