Some typos and minor style fixes.
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 03_MoreCatalystBasics.pod
index eb6092c..2c2ea7a 100644 (file)
@@ -64,8 +64,9 @@ will be too limited to be of use to anyone, it should provide a basic
 environment where we can explore a variety of features used in virtually
 all web applications.
 
-You can check out the source code for this example from the Catalyst
-Subversion repository as per the instructions in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter).  There are also instructions for downloading the code in
 L<Catalyst::Manual::Tutorial::01_Intro>.
 
 Please take a look at
@@ -108,7 +109,7 @@ if you are using Strawberry Perl.)
 =head1 EDIT THE LIST OF CATALYST PLUGINS
 
 One of the greatest benefits of Catalyst is that it has such a large
-library of bases classes and plugins available that you can use easily
+library of base classes and plugins available that you can use to easily
 add functionality to your application. Plugins are used to seamlessly
 integrate existing Perl modules into the overall Catalyst framework. In
 general, they do this by adding additional methods to the C<context>
@@ -142,16 +143,16 @@ If you prefer, there are several other ways to enable debug output:
 
 =item *
 
-Use the C<$c-E<gt>debug> method on the C<$c> Catalyst context object
+the C<$c-E<gt>debug> method on the C<$c> Catalyst context object
 
 =item *
 
-The C<-d> option to C<script/myapp_server.pl>
+the C<-d> option on the C<script/myapp_server.pl> script
 
 =item *
 
-The C<CATALYST_DEBUG=1> environment variable (or use C<CATALYST_DEBUG=0>
-to temporarily disable debug output).
+the C<CATALYST_DEBUG=1> environment variable (or C<CATALYST_DEBUG=0>
+to temporarily disable debug output)
 
 =back
 
@@ -205,7 +206,7 @@ images and CSS files, from the development server.
 
 =back
 
-For our application, we want to add one new plugin into the mix.  To do
+For our application, we want to add one new plugin to the mix.  To do
 this, edit C<lib/MyApp.pm> (this file is generally referred to as your
 I<application class>) and delete the lines with:
 
@@ -236,9 +237,9 @@ Don't let these variations confuse you -- they all accomplish the same
 result.
 
 This tells Catalyst to start using one additional plugin,
-L<Catalyst::Plugin::StackTrace>, to add a stack trace to the standard
-Catalyst "debug screen" (the screen Catalyst sends to your browser when
-an error occurs). Be aware that
+L<Catalyst::Plugin::StackTrace>, to add a stack trace near the top of
+the standard Catalyst "debug screen" (the screen Catalyst sends to your
+browser when an error occurs). Be aware that
 L<StackTrace|Catalyst::Plugin::StackTrace> output appears in your
 browser, not in the console window from which you're running your
 application, which is where logging output usually goes.
@@ -298,15 +299,15 @@ Use the Catalyst C<create> script to add a controller for book-related
 actions:
 
     $ script/myapp_create.pl controller Books
-     exists "/root/MyApp/script/../lib/MyApp/Controller"
-     exists "/root/MyApp/script/../t"
-    created "/root/MyApp/script/../lib/MyApp/Controller/Books.pm"
-    created "/root/MyApp/script/../t/controller_Books.t"
+     exists "/home/catalyst/MyApp/script/../lib/MyApp/Controller"
+     exists "/home/catalyst/MyApp/script/../t"
+    created "/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm"
+    created "/home/catalyst/MyApp/script/../t/controller_Books.t"
 
 Then edit C<lib/MyApp/Controller/Books.pm> (as discussed in
 L<Chapter 2|Catalyst::Manual::Tutorial::02_CatalystBasics> of
 the Tutorial, Catalyst has a separate directory under C<lib/MyApp> for
-each of the three parts of MVC: C<Model>, C<View>, and C<Controller>)
+each of the three parts of MVC: C<Model>, C<View> and C<Controller>)
 and add the following method to the controller:
 
     =head2 list
@@ -460,10 +461,10 @@ For our book application, enter the following command to enable the
 C<TT> style of view rendering:
 
     $ script/myapp_create.pl view HTML TT
-     exists "/root/MyApp/script/../lib/MyApp/View"
-     exists "/root/MyApp/script/../t"
-     created "/root/MyApp/script/../lib/MyApp/View/HTML.pm"
-     created "/root/MyApp/script/../t/view_HTML.t"
+     exists "/home/catalyst/MyApp/script/../lib/MyApp/View"
+     exists "/home/catalyst/MyApp/script/../t"
+     created "/home/catalyst/MyApp/script/../lib/MyApp/View/HTML.pm"
+     created "/home/catalyst/MyApp/script/../t/view_HTML.t"
 
 This creates a view called C<HTML> (the first argument) in a file called
 C<HTML.pm> that uses L<Catalyst::View::TT> (the second argument) as the
@@ -530,7 +531,7 @@ C<root/src>.
 
 Please stick with the settings above for the duration of the tutorial,
 but feel free to use whatever options you desire in your applications
-(as with most things Perl, there's more than one way to do it...).
+(as with most things in Perl, there's more than one way to do it...).
 
 B<Note:> We will use C<root/src> as the base directory for our template
 files, with a full naming convention of
@@ -581,7 +582,7 @@ looping, conditional logic, etc.  In general, TT simplifies the usual
 range of Perl operators down to the single dot (".") operator.  This
 applies to operations as diverse as method calls, hash lookups, and list
 index values (see L<Template::Manual::Variables> for details and
-examples).  In addition to the usual L<Template> module Pod
+examples).  In addition to the usual L<Template::Toolkit> module Pod
 documentation, you can access the TT manual at
 L<https://metacpan.org/module/Template::Manual>.
 
@@ -764,12 +765,12 @@ automatically build the required files for us:
     $ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
         create=static dbi:SQLite:myapp.db \
         on_connect_do="PRAGMA foreign_keys = ON"
-     exists "/root/MyApp/script/../lib/MyApp/Model"
-     exists "/root/MyApp/script/../t"
-    Dumping manual schema for MyApp::Schema to directory /root/MyApp/script/../lib ...
+     exists "/home/catalyst/MyApp/script/../lib/MyApp/Model"
+     exists "/home/catalyst/MyApp/script/../t"
+    Dumping manual schema for MyApp::Schema to directory /home/catalyst/MyApp/script/../lib ...
     Schema dump completed.
-    created "/root/MyApp/script/../lib/MyApp/Model/DB.pm"
-    created "/root/MyApp/script/../t/model_DB.t"
+    created "/home/catalyst/MyApp/script/../lib/MyApp/Model/DB.pm"
+    created "/home/catalyst/MyApp/script/../t/model_DB.t"
 
 Please note the '\' above.  Depending on your environment, you might be
 able to cut and paste the text as shown or need to remove the '\'
@@ -854,8 +855,8 @@ when you launch the application).
 Additionally, the C<lib/MyApp/Schema.pm> model can easily be loaded
 outside of Catalyst, for example, in command-line utilities and/or cron
 jobs. C<lib/MyApp/Model/DB.pm> provides a very thin "bridge" between
-Catalyst this external database model.  Once you see how we can add some
-powerful features to our DBIC model in
+Catalyst and this external database model.  Once you see how we can
+add some powerful features to our DBIC model in
 L<Chapter 4|Catalyst::Manual::Tutorial::04_BasicCRUD>, the elegance
 of this approach will start to become more obvious.
 
@@ -880,9 +881,9 @@ L<DBIx::Class::Schema::Loader> version C<0.05000> or later.
 =head1 ENABLE THE MODEL IN THE CONTROLLER
 
 Open C<lib/MyApp/Controller/Books.pm> and un-comment the model code we
-left disabled earlier so that your version matches the following (un-
-comment the line containing C<[$c-E<gt>model('DB::Book')-E<gt>all]> and
-delete the next 2 lines):
+left disabled earlier so that your version matches the following
+(un-comment the line containing C<[$c-E<gt>model('DB::Book')-E<gt>all]>
+and delete the next 2 lines):
 
     =head2 list
     
@@ -961,8 +962,8 @@ display something like:
     
     [debug] Loaded dispatcher "Catalyst::Dispatcher"
     [debug] Loaded engine "Catalyst::Engine"
-    [debug] Found home "/root/MyApp"
-    [debug] Loaded Config "/root/MyApp/myapp.conf"
+    [debug] Found home "/home/catalyst/MyApp"
+    [debug] Loaded Config "/home/catalyst/MyApp/myapp.conf"
     [debug] Loaded components:
     .-----------------------------------------------------------------+----------.
     | Class                                                           | Type     |
@@ -1380,7 +1381,7 @@ alternate way to specify the trace option just in case):
     $ DBIC_TRACE=1 script/myapp_server.pl -r
 
 Make sure that the application loads correctly and that you see the
-three dynamically created model class (one for each of the Result
+three dynamically created model classes (one for each of the Result
 Classes we created).
 
 Then hit the URL L<http://localhost:3000/books/list> with your browser
@@ -1460,11 +1461,11 @@ html" at the end of every field where a user has control over the
 information that can appear in that field (and can therefore inject
 markup or code if you don't "neutralize" those fields).  In addition to
 "| html", Template Toolkit has a variety of other useful filters that
-can found in the documentation for L<Template::Filters>.  (While we are
-on the topic of security and escaping of dangerous values, one of the
-advantages of using tools like DBIC for database access or
+can be found in the documentation for L<Template::Filters>.  (While we
+are on the topic of security and escaping of dangerous values, one of
+the advantages of using tools like DBIC for database access or
 L<HTML::FormFu> for form management [see
-L<Chapter 9|Catalyst::Manual::Tutorial::09_AdvancedCRUD::09_FormFu>
+L<Chapter 9|Catalyst::Manual::Tutorial::09_AdvancedCRUD::09_FormFu>]
 is that they automatically handle most escaping for you and therefore
 dramatically increase the security of your app.)
 
@@ -1618,12 +1619,12 @@ C<$c-E<gt>stash-E<gt>{template}> line has changed):
 You should now be able to access the L<http://localhost:3000/books/list>
 URL as before.
 
-B<NOTE:> Please note that if you use the default template technique, you
+B<NOTE:> If you use the default template technique, you
 will B<not> be able to use either the C<$c-E<gt>forward> or the
 C<$c-E<gt>detach> mechanisms (these are discussed in Chapter 2 and
 Chapter 9 of the Tutorial).
 
-B<IMPORTANT:> Make sure that you do NOT skip the following section
+B<IMPORTANT:> Make sure that you do B<not> skip the following section
 before continuing to the next chapter 4 Basic CRUD.
 
 
@@ -1641,17 +1642,18 @@ Check the L<http://localhost:3000/books/list> URL in your browser.  It
 should look the same manner as with earlier sections.
 
 
+You can jump to the next chapter of the tutorial here:
+L<Basic CRUD|Catalyst::Manual::Tutorial::04_BasicCRUD>
+
+
 =head1 AUTHOR
 
 Kennedy Clark, C<hkclark@gmail.com>
 
 Feel free to contact the author for any errors or suggestions, but the
 best way to report issues is via the CPAN RT Bug system at
-<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
-
-The most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
+L<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
 
-Copyright 2006-2010, Kennedy Clark, under the
+Copyright 2006-2011, Kennedy Clark, under the
 Creative Commons Attribution Share-Alike License Version 3.0
 (L<http://creativecommons.org/licenses/by-sa/3.0/us/>).