Create an Account
username: password:
 
  MemeStreams Logo

Catalyst Chained Dispatch Type (for localization) - Catalyst Advent Calendar - Day 10

search

Lost
Picture of Lost
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Lost's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
Catalyst Chained Dispatch Type (for localization) - Catalyst Advent Calendar - Day 10
Topic: Technology 10:48 am EST, Dec  6, 2007

Day 10 - The Chained Dispatch Type

A complete example of how to use Catalyst::DispatchType::Chained.
A basic introduction to Chained actions with Catalyst.

Frequently when building web applications there is a chain of dependency along the url path. That is, the controller dispatch logic has a close relationship to the data you want to draw from the model. Chained dispatch types provide an easy way to encapsulate this logic within your Catalyst controllers.

This Advent calendar entry is associated with a complete example application which shows how to use chained actions to provide this logic. The example application is available from the Catalyst subversion repository by issuing the following command:

$ svn co http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/ChainedEg

Please get a copy of this code before you proceed. The application is a very simple proof-of-concept application which will work with a basic Catalyst. There is no model, and the view is handled in the Root controller's end action (i.e. Controller::Root->end).

As an interesting aside, with appropriate introspection, by using Class::Inspector for example, it would be relatively straightforward to develop a custom view based on this end action to provide skeleton output during application development. For instance, you might want to use this in a situation where you have a pre-existing model but are not yet able to provide data for it.

Catalyst Chained Dispatch Type (for localization) - Catalyst Advent Calendar - Day 10



 
 
Powered By Industrial Memetics
RSS2.0