X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FCatalystBasics.pod;h=764566ab2c281eb7cd40e8879d5320c18bd41830;hp=b288293ffc457b87912d0086d3f1ea115ccd8c01;hb=3b1fa91be1d89d2297aa9e8e83462344d9cd9820;hpb=1435672d3f51326b8f15006abcfe98180e89becb diff --git a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod index b288293..764566a 100644 --- a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod @@ -1,11 +1,11 @@ =head1 NAME -Catalyst::Manual::Tutorial::CatalystBasics - Catalyst Tutorial - Part 2: Catalyst Application Development Basics +Catalyst::Manual::Tutorial::CatalystBasics - Catalyst Tutorial - Chapter 2: Catalyst Application Development Basics =head1 OVERVIEW -This is B for the Catalyst tutorial. +This is B for the Catalyst tutorial. L @@ -56,8 +56,9 @@ L =head1 DESCRIPTION -In this part of the tutorial, we will create a very basic Catalyst web -application, demonstrating a number of powerful capabilities, such as: +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 @@ -121,9 +122,8 @@ 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 part of the tutorial, use the Catalyst -C script to initialize the framework for an -application called C: +In this first chapter of the tutorial, use the Catalyst C +script to initialize the framework for an application called C: $ catalyst.pl Hello created "Hello" @@ -179,7 +179,8 @@ 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: +server (make sure you didn't forget the "C" from the +previous step): $ script/hello_server.pl [debug] Debug messages enabled @@ -207,6 +208,7 @@ server: +----------------------+--------------------------------------+--------------+ | /default | Hello::Controller::Root | default | | /end | Hello::Controller::Root | end | + | /index | Hello::Controller::Root | index | '----------------------+--------------------------------------+--------------' [debug] Loaded Path actions: @@ -216,24 +218,25 @@ server: | / | /default | | / | /index | '-------------------------------------+--------------------------------------' - - [info] Hello powered by Catalyst 5.7014 - You can connect to your server at http://localhost:3000 + + [info] Hello powered by Catalyst 5.80003 + You can connect to your server at http://debian:3000 Point your web browser to L (substituting a different hostname or IP address as appropriate) and you should be -greeted by the Catalyst welcome screen. Information similar to the -following should be appended to the logging output of the development -server: - - [info] *** Request 1 (1.000/s) [10301] [Sun Nov 23 10:11:36 2008] *** - [debug] "GET" request for "/" from "127.0.0.1" - [info] Request took 0.017964s (55.667/s) +greeted by the Catalyst welcome screen (if you get some other welcome +screen or an "Index" screen, you probably forgot to specify port 3000 +in your URL). Information similar to the following should be appended +to the logging output of the development server: + + [info] *** Request 1 (0.005/s) [20712] [Sun Mar 8 15:49:09 2009] *** + [debug] "GET" request for "/" from "1.1.1.98" + [info] Request took 0.007342s (136.203/s) .----------------------------------------------------------------+-----------. | Action | Time | +----------------------------------------------------------------+-----------+ - | /default | 0.000540s | - | /end | 0.001246s | + | /index | 0.000491s | + | /end | 0.000595s | '----------------------------------------------------------------+-----------' Press Ctrl-C to break out of the development server. @@ -301,6 +304,9 @@ file: $c->response->body("Hello, World!"); } +B: See Appendix 1 for tips on removing the leading spaces when +cutting and pasting example code from POD-based documents. + Here you're sending your own string to the webpage. Save the file, start the server (stop and restart it if it's still @@ -353,7 +359,7 @@ Template Toolkit is a very full featured template facility, with excellent documentation at L, but since this is not a TT tutorial, we'll stick to only basic TT usage here (and explore some of the more common TT features in later -parts of the tutorial). +chapters of the tutorial). Create a C template file (put it in the C under the C directory that is the base of your application). Here is