X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F03_MoreCatalystBasics.pod;h=5137dc47dfb839022dc2d7a3c009fedcd53980bc;hb=0f387d99bf67ce156b684ad2dedb7d755fc30223;hp=ee72ff97c9613e500edb1e2589ee2139fcfedeb3;hpb=c6b49844b992185f956b556f3a5d14da67f7aa14;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod index ee72ff9..5137dc4 100644 --- a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod @@ -64,16 +64,19 @@ 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 +directory of the Tutorial Virtual machine (one subdirectory per +chapter). There are also instructions for downloading the code in L. Please take a look at -L before -doing the rest of this tutorial. Although the tutorial should work -correctly under most any recent version of Perl running on any operating -system, the tutorial has been written using Debian 6 and tested to be -sure it runs correctly in this environment. +L +before doing the rest of this tutorial. Although the tutorial should +work correctly under most any recent version of Perl running on any +operating system, the tutorial has been written using the virtual +machine that is available for download. The entire tutorial has been +tested to be sure it runs correctly in this environment, so it is +the most trouble-free way to get started with Catalyst. =head1 CREATE A NEW APPLICATION @@ -234,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, 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, 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 output appears in your browser, not in the console window from which you're running your application, which is where logging output usually goes. @@ -296,10 +299,10 @@ Use the Catalyst C script to add a controller for book-related actions: $ script/myapp_create.pl controller Books - exists "/home/me/MyApp/script/../lib/MyApp/Controller" - exists "/home/me/MyApp/script/../t" - created "/home/me/MyApp/script/../lib/MyApp/Controller/Books.pm" - created "/home/me/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 (as discussed in L of @@ -458,10 +461,10 @@ For our book application, enter the following command to enable the C style of view rendering: $ script/myapp_create.pl view HTML TT - exists "/home/me/MyApp/script/../lib/MyApp/View" - exists "/home/me/MyApp/script/../t" - created "/home/me/MyApp/script/../lib/MyApp/View/HTML.pm" - created "/home/me/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 (the first argument) in a file called C that uses L (the second argument) as the @@ -505,12 +508,15 @@ could be different depending on the version of Catalyst you are using): ); -Change this to match the following: +Change this to match the following (insert a new +C<__PACKAGE__-Econfig> below the existing statement): __PACKAGE__->config( name => 'MyApp', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback => 1, + ); + __PACKAGE__->config( # Configure the view 'View::HTML' => { #Set the location for TT files @@ -576,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 for details and -examples). In addition to the usual L