docs: updated Intro.pod and Tutorial.pod for modern Catalysts; more details of URL...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Manual / Tutorial.pod
index eb1af71..e26ae30 100644 (file)
@@ -25,7 +25,6 @@ install them for you.
 Catalyst includes a helper script, C<catalyst.pl>, that will set up a 
 skeleton application for you:
 
-    $ catalyst.pl My::App
     created "My-App"
     created "My-App/script"
     created "My-App/lib"
@@ -39,17 +38,18 @@ skeleton application for you:
     created "My-App/lib/My/App/V"
     created "My-App/lib/My/App/C"
     created "My-App/lib/My/App.pm"
+    created "My-App/Build.PL"
     created "My-App/Makefile.PL"
     created "My-App/README"
     created "My-App/Changes"
     created "My-App/t/01app.t"
-    created "My-App/t/02podcoverage.t"
-    created "My-App/script/cgi.pl"
-    created "My-App/script/nph-cgi.pl"
-    created "My-App/script/fcgi.pl"
-    created "My-App/script/server.pl"
-    created "My-App/script/test.pl"
-    created "My-App/script/create.pl"
+    created "My-App/t/02pod.t"
+    created "My-App/t/03podcoverage.t"
+    created "My-App/script/my_app_cgi.pl"
+    created "My-App/script/my_app_fastcgi.pl"
+    created "My-App/script/my_app_server.pl"
+    created "My-App/script/my_app_test.pl"
+    created "My-App/script/my_app_create.pl"
 
 This creates the directory structure shown, populated with skeleton 
 files.
@@ -59,23 +59,26 @@ files.
 =head2 Testing out the sample application
 
 You can test out your new application by running the server script that
-catalyst provides:
+Catalyst provides:
 
     $ cd My-App
-    $ script/server.pl 
+    $ script/my_app_server.pl 
+
     [...] [catalyst] [debug] Debug messages enabled
+    [...] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
     [...] [catalyst] [debug] Loaded engine "Catalyst::Engine::HTTP"
+    [...] [catalyst] [debug] Found home "/usr/home/jester/foo/My-App/script/.."
     [...] [catalyst] [debug] Loaded private actions
-    .=----------------------+----------------------+---------------=.
-    | Private               | Class                | Code           |
-    |=----------------------+----------------------+---------------=|
-    | /default              | MyApp                | CODE(0x86f08ac |
-    '=----------------------+----------------------+---------------='
-     "My::App" defined "!default" as "CODE(0x83fd570)"
-    [...] [catalyst] [info] My::App powered by Catalyst 5.00
-    You can connect to your server at http://localhost:3000
-
-(Note that each line logged by Catalyst includes a timestamp, which has
+    .=--------------------------------+------------------------------------=.
+    | Private                         | Class                               |
+    |=--------------------------------+------------------------------------=|
+    | /default                        | My::App                             |
+    '=--------------------------------+------------------------------------='
+
+    [....] [catalyst] [info] My::App powered by Catalyst 5.20
+    You can connect to your server at http://localhost:3000/
+
+(Note that each line logged by Catalyst begins with a timestamp, which has
 been replaced here with "C<...>" so that the text fits onto the lines.)
 
 The server is now waiting for you to make requests of it.  Try using 
@@ -90,10 +93,10 @@ and hit return twice):
     GET / HTTP/1.0
     
     HTTP/1.0 200
-    Server: Catalyst/5.00
+    Server: Catalyst/5.20
     Status: 200
-    Date: Sun, 20 Mar 2005 12:31:55 GMT
-    X-catalyst: 5.00
+    Date: Fri May 13 14:15:46 EDT 2005
+    X-catalyst: 5.20
     Content-length: 40
     Content-Type: text/html; charset=ISO-8859-1
 
@@ -117,7 +120,7 @@ More trace messages will appear in the original terminal window:
 The server will continue running until you interrupt it.
 
 The application can also be tested from the command line using the generated
-helper script, C<script/test.pl>.
+helper script, C<script/my_app_test.pl>.
 
 
 =head2 Getting your application invoked
@@ -186,7 +189,7 @@ the application module).
 The call to C<config> sets up configuration data for the application.  
 The C<name> and C<root> items are the minimum required, and specify 
 the name of the application and the path to the root directory where 
-documents, images and templates can be found.
+documents, images, and templates can be found.
 
 Catalyst associates I<actions> with URLs and on receiving a request 
 dispatches to the action that matches to request URL.  The call to 
@@ -195,10 +198,10 @@ this action registered the application will respond to all requests
 with the same message "Congratulations, My::App is on Catalyst!".
 
 As you see, the default action is defined as a Private action. 
-Most private actions are not directly available from a web url. The
-exceptions are the built-in actions, 'default','begin','end' and
-'auto'. The rest can only be reached by using C<forward>.
-
+Most private actions are not directly available from a web url. This
+also includes the built-in actions, 'default','begin','end', and
+'auto', although they will be called as part of some chains.  
+The rest can only be reached by using C<forward>.
 
 The call to the C<setup> method also triggers the second stage of 
 Catalyst's initialization process.  In this phase Catalyst searches 
@@ -229,7 +232,7 @@ You can start extending the application by adding new actions:
     }
 
 
-TODO: explain briefly about plugins, actions and components
+TODO: explain briefly about plugins, actions, and components
 
 regex actions passed subexpression matches in $c->req->snippets
 (array ref).
@@ -243,21 +246,21 @@ Catalyst works well with Template Toolkit.  If you are unfamiliar with
 Template Toolkit then I suggest you look at L<http://tt2.org>, install 
 C<Template>, read the documentation and play around with it, and have 
 a look at the I<Badger Book> (I<Template Toolkit> by Darren 
-Chamberlain, Dave Cross and Andy Wardly, O'Reilly & Associates, 2004).
+Chamberlain, Dave Cross, and Andy Wardley, O'Reilly & Associates, 2004).
 
 You can create a stub Template Toolkit view component using the create 
 script that Catalyst set up as part of the skeleton application:
 
     $ script/create.pl view TT TT
 
-this generates a view component named C<My::App::View::TT>, which you 
+this generates a view component named C<My::App::V::TT>, which you 
 might use by forwarding from your C<end> action:
 
     # In My::App or My::App::Controller::SomeController
 
     sub end : Private {
         my($self, $c) = @_;
-        $c->forward('My::App::View::TT');
+        $c->forward('My::App::V::TT');
     }
 
 The generated TT view component simply subclasses the 
@@ -298,16 +301,16 @@ document is as follows:
 
 =item 1
 
-expand this document fairly rapidly to cover topics relevant to
-a newcomer to Catalyst in an order that can be read sequentially
+Expand this document fairly rapidly to cover topics relevant to
+a newcomer to Catalyst, in an order that can be read sequentially
 
 =item 2
 
-incorporate feedback 
+Incorporate feedback 
 
 =item 3
 
-revise the text 
+Revise the text 
 
 =back