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=1bcb2c08774301a1cfa012329a917a0a8882f7cf;hp=29ea997d95a4ba857ad762ddbd8d11bd2b3dd46b;hb=d04961970a25ec3dc831f89be5cd6e27fdec884a;hpb=c010ae0de590159369925f16f03dcad4732a91e6 diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index 29ea997..1bcb2c0 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -140,6 +140,34 @@ 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 following along in Ubuntu 8.04 or +otherwise 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. Because Catalyst has long supported both formats, this +tutorial will simply use a configuration file called C +instead of C and Catatlyst will automcatically use the new +format. Just be aware that earlier versions of Catalyst will still +create the C file and that you will need to B> and create a new C file by hand, but +otherwise this transition is very painless. The default contents of +C should only consist of one line: C. Also be +aware that you can continue to use any format supported by +L and +L, including YAML -- Catalyst will +automatically look for any of the supported configuration file +formats. + +B: This script can be useful for converting between configuration +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 @@ -220,7 +248,7 @@ to the controller: # Retrieve all of the book records as book model objects and store in the # stash where they can be accessed by the TT template - $c->stash->{books} = [$c->model('MyAppDB::Books')->all]; + $c->stash->{books} = [$c->model('DB::Books')->all]; # Set the TT template to use. You will almost always want to do this # in your action methods (action methods respond to user input in @@ -229,7 +257,7 @@ to the controller: } B This won't actually work yet since you haven't set up your -model yet. +model yet. We will be covering the model soon. B Programmers experienced with object-oriented Perl should recognize C<$self> as a reference to the object where this method was @@ -239,8 +267,8 @@ C<$context>). The Context object is automatically passed to all Catalyst components. It is used to pass information between components and provide access to Catalyst and plugin functionality. -B: You may see the C<$c-Emodel('MyAppDB::Book')> used above -written as C<$c-Emodel('MyAppDB')-Eresultset('Book)>. The two +B: You may see the C<$c-Emodel('DB::Book')> used above +written as C<$c-Emodel('DB')-Eresultset('Book)>. The two are equivalent. B Catalyst actions are regular Perl methods, but they make use @@ -273,11 +301,11 @@ possibly using other display output- generation systems. As with virtually every aspect of Catalyst, options abound when it comes to the specific view technology you adopt inside your application. However, most Catalyst applications use the Template Toolkit, known as -TT (for more information on TT, see L). Other popular view technologies include Mason -(L and L) and -L (L). +TT (for more information on TT, see +L). Other popular view technologies +include Mason (L and +L) and L +(L). =head2 Create a Catalyst View Using C @@ -455,7 +483,7 @@ for details and examples). In addition to the usual C