X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FMoreCatalystBasics.pod;h=2b94d3aa0b1efbc4c23b8be06c1d6fb2797ee43e;hp=fef48feb79f11d03cbef2ceda2021eba2e9dbb72;hb=acbd7bddabb7f0d62f0e031e21d440a0ae496d6d;hpb=245b41d18d896641288e60c37d687ae25c716db1 diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index fef48fe..2b94d3a 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -75,7 +75,7 @@ The remainder of the tutorial will build an application called C. First use the Catalyst C script to initialize the framework for the C application (make sure you aren't still inside the directory of the C application from the previous part of the -tutorial): +tutorial or in a directory that already has a "MyApp" subdirectory): $ catalyst.pl MyApp created "MyApp" @@ -140,20 +140,21 @@ very similar to Apache configuration files. We will see how to use this feature of Catalyst during the authentication and authorization sections (Part 5 and Part 6). -B If you are using a version of -L prior to version 1.06, you need to -be aware that Catalyst changed from a default format of YAML to the -more straightforward C format. This tutorial use the -newer C configuration file for C instead -of C for YAML. However, Catalyst has long supported both -formats and Catalyst will automatically use either C or -C (or any other format supported by -L and -L). If you are using a versions of -Catalyst::Devel prior to 1.06, you can convert to the newer format by -simply creating the C file manually and deleting -C. The default contents of C should only -consist of one line: C. +B If you are using a version of +L prior to version 1.06, be aware +that Catalyst changed the default format from YAML to the more +straightforward C style. This tutorial uses the +newer C file for C. However, Catalyst +supports both formats and will automatically use either C +or C (or any other format supported by +L and +L). If you are using a version of +Catalyst::Devel prior to 1.06, you can convert to the newer format by +simply creating the C file manually and deleting +C. The default contents of the C you create +should only consist of one line: + + name MyApp B: This script can be useful for converting between configuration formats: @@ -161,10 +162,6 @@ formats: perl -Ilib -e 'use MyApp; use Config::General; Config::General->new->save_file("myapp.conf", MyApp->config);' -B The default C should look like: - - name MyApp - =item * L @@ -176,31 +173,27 @@ as images and CSS files under the development server. For our application, we want to add one new plugin into the mix. To do this, edit C (this file is generally referred to as -your I) and delete the line with: +your I) and delete the lines with: - __PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); + use Catalyst qw/-Debug + ConfigLoader + Static::Simple/; Then replace it with: - __PACKAGE__->setup(qw/ - -Debug - ConfigLoader - Static::Simple - - StackTrace - /); + # Load plugins + use Catalyst qw/-Debug + ConfigLoader + Static::Simple + + StackTrace + /; B Recent versions of C have used a variety of -techniques to load these plugins/flags. If you are following along in -Ubuntu 8.10, you should have C v1.07 and see the -default code shown above. If you are using v1.08, you should see the -following by default: +techniques to load these plugins/flags. For example, you might see +the following: - use Catalyst qw/-Debug - ConfigLoader - Static::Simple/; - ... - __PACKAGE__->setup(); + __PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); Don't let these variations confuse you -- they all accomplish the same result. @@ -315,11 +308,11 @@ method" that you don't want to be an action at all, then just define the method without any attribute -- you can call it in your code, but the Catalyst dispatcher will ignore it.) -=over 4 - There are five types of "special" build-in C<:Private> actions: C, C, C, C, and C. +=over 4 + =item * With C, C, C, C private actions, only the @@ -469,6 +462,12 @@ C to C. These changes from the default are done mostly to facilitate the application we're developing in this tutorial; as with most things Perl, there's more than one way to do it... +B We will use C as the base directory for our +template files, which a full naming convention of +C. Another popular option is to +use C as the base (with a full filename pattern of +C). + =head2 Create a TT Template Page @@ -606,7 +605,7 @@ can use the SQLite command line environment to do a quick dump of the database contents: $ sqlite3 myapp.db - SQLite version 3.4.2 + SQLite version 3.5.9 Enter ".help" for instructions sqlite> select * from books; 1|CCSP SNRS Exam Certification Guide|5 @@ -635,6 +634,7 @@ your OS command prompt. For using other databases, such as PostgreSQL or MySQL, see L. + =head1 DATABASE ACCESS WITH C Catalyst can be used with virtually any form of persistent datastore @@ -664,19 +664,37 @@ starts: created "/home/me/MyApp/script/../t/model_DB.t" +The C