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=b6d944d5690c841b1460cbe40df5ec95db78bdfd;hp=3ec9249593b78d5914f09e6f4a9303df80454bc3;hb=0416017e10f523ec522ef48e0acef28217b57b55;hpb=4e1c81079691f91c7ab2c3b65ba0d981af660e04 diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index 3ec9249..b6d944d 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -294,26 +294,89 @@ 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 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 -and C attribute in lieu of C<: Local> and C<: Private>. For -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 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 -L as well as Part 5 -of this tutorial (Authentication) for additional information. Another -popular but more advanced feature is C actions that allow a -single URL to "chain together" multiple action method calls, each with -an appropriate number of arguments (see -L for -details). +Catalyst actions are regular Perl methods, but they make use +of attributes (the "C<: Local>" next to the "C" in the code +above) to provide additional information to the Catalyst dispatcher +logic (note that the space between the colon and the attribute name is +optional... you will see them written both ways). Over time, the +recommended style for most Catalyst applications has changed: + +=over 4 + +=item * From "C<:Local>" and "C<:Private>" + +=item * To "C<:Path>" and "C<:Args>" + +=item * To "C<:Chained>" + +=back + +Although all three styles work just fine, the newer forms offer more +advanced capbilities and allow you to be more expressive with the URIs +that your application uses. + +Here is a quick summary of the most commonly used action types: +C, C, C and C: + +=over 4 + +=item * + +B -- In the past, the majority of applications have +traditionally used C actions for items that respond to user +requests and C actions for those that do not directly respond +to user input. + +=over 4 + +There are five types of build-in C actions: C, +C, C, C, and C. + +=item * + +With C, C, C, C private actions, only the +most specific action of each type will be called. For example, if you +define a C action in your controller it will I a +C action in your application/root controller -- I the +action in your controller will be called. + +=item * + +Unlike the other actions where only a single method is called for each +request, I auto action along the chain of namespaces will be +called. Each C action will be called I. + +=back + +=item * + +B -- C actions were the next style of action types to +become popular and essentially provide a limited subset of what can be +found done with Chained actions. You can match on different portions +of the URI (for example C in +C would match on the URL +C but C would match +on C) and it let's you be very specific with +what arguments each controller method will accept. See +L for more information and a few +examples. + +=item * + +B -- Newer Catalyst applications tend to use the Chained +dispatch form of action types because of its power and flexibility. +It allows a series of controller methods to automatically be dispatched +to service a single user request. See +L +and L +for more information on chained actions. + +=back + +You should refer to L for +additional information and for coverage of some lesser-used action +types not discussed here (C, C and C). =head1 CATALYST VIEWS