Create an Account
username: password:
 
  MemeStreams Logo

MemeStreams Discussion

search


This page contains all of the posts and discussion on MemeStreams referencing the following web page: Catalyst Chained Dispatch Type (for localization) - Catalyst Advent Calendar - Day 10. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

Catalyst Chained Dispatch Type (for localization) - Catalyst Advent Calendar - Day 10
by Lost at 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.


 
 
Powered By Industrial Memetics