X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F02_CatalystBasics.pod;h=7184a7e3cf90c84a5cd1888280255a9380524082;hp=28f3ab0a1b15d248888d7fc2a4af384ca7d9d400;hb=HEAD;hpb=af0a93cff5b96bfce3983b6ca99efce2145d5912 diff --git a/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod index 28f3ab0..7184a7e 100644 --- a/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/02_CatalystBasics.pod @@ -56,8 +56,8 @@ L =head1 DESCRIPTION -In this chapter of the tutorial, we will create a very basic Catalyst -web application, demonstrating a number of powerful capabilities, such +In this chapter of the tutorial, we will create a very basic Catalyst +web application, demonstrating a number of powerful capabilities, such as: =over 4 @@ -74,7 +74,7 @@ clean "separation of control" between the different portions of your application. Given that many other documents cover this subject in detail, MVC will not be discussed in depth here (for an excellent introduction to MVC and general Catalyst concepts, please see -L). In short: +L). In short: =over 4 @@ -89,7 +89,7 @@ database. The view takes model objects and renders them into something for the end user to look at. Normally this involves a template-generation tool that creates HTML for the user's web browser, but it could easily be code -that generates other forms such as PDF documents, e-mails, spreadsheets, +that generates other forms such as PDF documents, e-mails, spreadsheets, or even "behind the scenes" formats such as XML and JSON. =item * Controller @@ -110,20 +110,20 @@ automatically create our Catalyst model for use with a database. You can checkout the source code for this example from the catalyst subversion repository as per the instructions in -L. +L. =head1 CREATE A CATALYST PROJECT -Catalyst provides a number of helper scripts that can be used to -quickly flesh out the basic structure of your application. All -Catalyst projects begin with the C helper (see -L for more information on helpers). -Also note that as of Catalyst 5.7000, you will not have the helper -scripts unless you install both L -and L. +Catalyst provides a number of helper scripts that can be used to quickly +flesh out the basic structure of your application. All Catalyst projects +begin with the F helper (see +L for more information on helpers). +Also note that as of Catalyst 5.7000, you will not have the helper +scripts unless you install both L +and L. -In this first chapter of the tutorial, use the Catalyst C +In this first chapter of the tutorial, use the Catalyst F script to initialize the framework for an application called C: $ catalyst.pl Hello @@ -140,13 +140,13 @@ Note: If you are using Strawberry Perl on Win32, drop the ".pl" from the end of the "catalyst.pl" command and simply use "catalyst Hello". -The C helper script will display the names of the +The F helper script will display the names of the directories and files it creates: Changes # Record of application changes lib # Lib directory for your app's Perl modules Hello # Application main code directory - Controller # Directory for Controller modules + Controller # Directory for Controller modules Model # Directory for Models View # Directory for Views Hello.pm # Base application module @@ -164,57 +164,56 @@ directories and files it creates: hello_server.pl # The normal development server hello_test.pl # Test your app from the command line t # Directory for tests - 01app.t # Test scaffold - 02pod.t - 03podcoverage.t - - -Catalyst will "auto-discover" modules in the Controller, Model, and -View directories. When you use the hello_create.pl script it will -create Perl module scaffolds in those directories, plus test files in -the "t" directory. The default location for templates is in the "root" -directory. The scripts in the script directory will always start with -the lowercased version of your application name. If your app is -MaiTai, then the create script would be "maitai_create.pl". - -Though it's too early for any significant celebration, we already have -a functioning application. We can use the Catalyst supplied script to -start up a development server and view the default Catalyst page in -your browser. All scripts in the script directory should be run from -the base directory of your application, so change to the Hello -directory. - -Run the following command to start up the built-in development web -server (make sure you didn't forget the "C" from the -previous step): - -B: The "-r" argument enables reloading on code changes so you -don't have to stop and start the server when you update code. See -C for additional options you might find -helpful. Most of the rest of the tutorial will assume that you are using -"-r" when you start the development server, but feel free to manually -start and stop it (use C to break out of the dev server) if you -prefer. + 01app.t # Test scaffold + 02pod.t + 03podcoverage.t + + +Catalyst will "auto-discover" modules in the Controller, Model, and View +directories. When you use the F script it will create Perl +module scaffolds in those directories, plus test files in the "t" +directory. The default location for templates is in the "root" +directory. The scripts in the script directory will always start with +the lowercased version of your application name. If your app is MaiTai, +then the create script would be "maitai_create.pl". + +Though it's too early for any significant celebration, we already have a +functioning application. We can use the Catalyst supplied script to +start up a development server and view the default Catalyst page in your +browser. All scripts in the script directory should be run from the base +directory of your application, so change to the Hello directory. + +Run the following command to start up the built-in development web +server (make sure you didn't forget the "C" from the previous +step): + +B: The "-r" argument enables reloading on code changes so you +don't have to stop and start the server when you update code. See +C or C