X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F03_MoreCatalystBasics.pod;h=f8751f11926c174bc8d0c5d82eaee55cdbdf94df;hp=c92075ceb8fd89095d6f9eadcb97499afb8c070b;hb=1edbdee6a1bad3524a3d97c6daaae02b5109c1d2;hpb=0ed3df53a9644cf30fe2a79828fd2e15044dbcd6 diff --git a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod index c92075c..f8751f1 100644 --- a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod @@ -436,22 +436,20 @@ but its use is now deprecated. Enter the following command to enable the C style of view rendering for this tutorial: - $ script/myapp_create.pl view TT TT + $ 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/TT.pm" - created "/home/me/MyApp/script/../t/view_TT.t" - -This simply creates a view called C (the second 'TT' argument) in -a file called C (the first 'TT' argument). It is now up to you -to decide how you want to structure your view layout. For the -tutorial, we will start with a very simple TT template to initially -demonstrate the concepts, but quickly migrate to a more typical -"wrapper page" type of configuration (where the "wrapper" controls the -overall "look and feel" of your site from a single file or set of -files). - -Edit C and you should see that the default + created "/home/me/MyApp/script/../lib/MyApp/View/HTML.pm" + created "/home/me/MyApp/script/../t/view_HTML.t" + +This simply creates a view called C in a file called C (the first +argument). It is now up to you to decide how you want to structure your view +layout. For the tutorial, we will start with a very simple TT template to +initially demonstrate the concepts, but quickly migrate to a more typical +"wrapper page" type of configuration (where the "wrapper" controls the overall +"look and feel" of your site from a single file or set of files). + +Edit C and you should see that the default contents contains something similar to the following: __PACKAGE__->config(TEMPLATE_EXTENSION => '.tt'); @@ -699,14 +697,16 @@ run this command: $ perl -MCatalyst::Model::DBIC::Schema -e \ 'print "$Catalyst::Model::DBIC::Schema::VERSION\n"' - 0.39 + 0.4 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 '\' character to that the command is all on a single line. -If you have less than v0.39, you will need to run this command to -install it directly from CPAN: +If you are following along in Debian 5, you should have version 0.40 or +higher (shown above as "0.4" with the tailing zero removed). If you have +less than v0.39, you will need to run this command to install it +directly from CPAN: $ sudo cpan Catalyst::Model::DBIC::Schema @@ -897,7 +897,7 @@ enter: $ export DBIC_TRACE=1 $ script/myapp_server.pl -r - + This assumes you are using bash as your shell -- adjust accordingly if you are using a different shell (for example, under tcsh, use C). @@ -934,7 +934,7 @@ display something like: | MyApp::Model::DB::Author | class | | MyApp::Model::DB::Book | class | | MyApp::Model::DB::BookAuthor | class | - | MyApp::View::TT | instance | + | MyApp::View::HTML | instance | '-----------------------------------------------------------------+----------' [debug] Loaded Private actions: @@ -1016,12 +1016,12 @@ will appear across your entire site/application instead of having to edit many individual files. -=head2 Configure TT.pm For The Wrapper +=head2 Configure HTML.pm For The Wrapper In order to create a wrapper, you must first edit your TT view and tell it where to find your wrapper file. -Edit you TT view in C and change it to match the +Edit you TT view in C and change it to match the following: __PACKAGE__->config( @@ -1174,7 +1174,7 @@ provide lots of high-quality CSS functionality. Hit "Reload" in your web browser and you should now see a formatted version of our basic book list. (Again, the development server should have automatically restarted when you made changes to -C. If you are not using the "-r" option, you will +C. If you are not using the "-r" option, you will need to hit C and manually restart it. Also note that the development server does I need to restart for changes to the TT and static files we created and edited in the C directory -- those @@ -1282,10 +1282,9 @@ above: { join_type => "LEFT" }, ); - The arguments are similar, but see L for the details. - + Although recent versions of SQLite and L automatically handle the C and C relationships, C relationships currently need to be manually inserted. @@ -1336,7 +1335,7 @@ ANYTHING ABOVE!> comment): Run the Catalyst development server script with the C option (it might still be enabled from earlier in the tutorial, but here is an -alternate way to specify the option just in case): +alternate way to specify the trace option just in case): $ DBIC_TRACE=1 script/myapp_server.pl -r @@ -1345,8 +1344,7 @@ three dynamically created model class (one for each of the Result Classes we created). Then hit the URL L with your browser -and be sure that the book list still displays correctly. You can leave -the development server running for the next step if you wish. +and be sure that the book list still displays correctly. B You will not see the authors yet because the view does not yet use the new relations. Read on to the next section where we update the @@ -1585,7 +1583,7 @@ statement in C in C: $c->stash(template => 'books/list.tt2'); Then delete the C line in -C. +C. Check the L URL in your browser. It should look the same manner as with earlier sections.