Catalyst::Helper - Bootstrap a Catalyst application
catalyst.pl <myappname>
This module is used by catalyst.pl to create a set of scripts for a new catalyst application. The scripts each contain documentation and will output help on how to use them if called incorrectly or in some cases, with no arguments.
It also provides some useful methods for a Helper module to call when creating a component. See "METHODS".
Used to create new components for a catalyst application at the development stage.
The catalyst test server, starts an HTTPD which outputs debugging to the terminal.
A script for running tests from the command-line.
Run your application as a CGI.
Run the application as a fastcgi app. Either by hand, or call this from FastCgiServer in your http server config.
The "_create.pl" script creates application components using Helper modules. The Catalyst team provides a good number of Helper modules for you to use. You can also add your own.
Helpers are classes that provide two methods.
* mk_compclass - creates the Component class * mk_comptest - creates the Component test
So when you call scripts/myapp_create.pl view MyView TT, create will try to execute Catalyst::Helper::View::TT->mk_compclass and Catalyst::Helper::View::TT->mk_comptest.
scripts/myapp_create.pl view MyView TT
See Catalyst::Helper::View::TT and Catalyst::Helper::Model::DBIC for examples.
All helper classes should be under one of the following namespaces.
Catalyst::Helper::Model:: Catalyst::Helper::View:: Catalyst::Helper::Controller::
This method in your Helper module is called with $helper which is a Catalyst::Helper object, and whichever other arguments the user added to the command-line. You can use the $helper to call methods described below.
$helper
If the Helper module does not contain a mk_compclass method, it will fall back to calling "render_file", with an argument of compclass.
mk_compclass
compclass
If the Helper module does not contain a mk_compclass method, it will fall back to calling "render_file", with an argument of comptest.
comptest
This method is called if the user does not supply any of the usual component types view, controller, model. It is passed the $helper object (an instance of Catalyst::Helper), and any other arguments the user typed.
view
controller
model
There is no fallback for this method.
These are the methods that the Helper classes can call on the <$helper> object passed to them.
Render and create a file from a template in DATA using Template Toolkit.
Fetch file contents from the DATA section. This is used internally by "render_file".
Create the main application skeleton. This is called by catalyst.pl.
This method is called by create.pl to make new components for your application.
Surprisingly, this function makes a directory.
Writes content to a file. Called by "render_file".
Calculates the name of the next numbered test file and returns it.
The helpers will read author name from /etc/passwd by default. To override, please export the AUTHOR variable.
Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst
Sebastian Riedel, sri@oook.de
sri@oook.de
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Devel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Devel
CPAN shell
perl -MCPAN -e shell install Catalyst::Devel
For more information on module installation, please visit the detailed CPAN module installation guide.