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=cf413cda339e895b1ba927d735265a2e61ed1ee5;hp=e15c9c1f8f9f32643956e89a3fd7d23b8f406b8d;hb=9ad715b3a89ba2d34123a2d0f4624302bc169f78;hpb=056394af33148bedf19220d5f4934bf2615d84e8 diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index e15c9c1..cf413cd 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -140,7 +140,7 @@ 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 +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 @@ -158,12 +158,15 @@ L, including YAML -- Catalyst will automatically look for any of the supported configuration file formats. -C: This script can be useful for converting between configuration +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 * @@ -205,6 +208,10 @@ Note: 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. +B You will want to disable +L before you put your +application into production, but it can be helpful during development. + =back Note that when specifying plugins on the C line, you can @@ -245,7 +252,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 @@ -254,7 +261,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 @@ -264,20 +271,20 @@ 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 of Nicholas Clark's C module (that's the C<: Local> next to the C in the code above) to provide additional information to the Catalyst dispatcher logic. Many newer Catalyst -applications are switching to the use of "Literal" C<: Path> actions +applications are switching to the use of "Literal" C<:Path> actions and C attribute in lieu of C<: Local> and C<: Private>. For -example, C can be used instead of +example, C can be used instead of C (because no path was supplied to C it matches the "empty" URL in the namespace of that module... the same -thing C would do) or C +thing C would do) or C could be used instead of the C above (the C argument to C would make it match on the URL C under C, the namespace of the current module). See "Action Types" in @@ -298,11 +305,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 @@ -480,7 +487,7 @@ for details and examples). In addition to the usual C