Revision 3 - 2009-03-13 at 10:54:36

Create Custom Controller Attributes

Many base controllers like Catalyst::Controller::HTML::FormFu make use of those nifty attributes.

sub form : Form { ... }

This action will automatically load a config file and puts a HTML::FormFu object in the stash.

Add this piece of code to your controller

sub _parse_NSPathPart_attr {
    my ( $self ) = @_;
    return ( PathPart =>     $self->action_namespace() );
}

This will add a NSPathPart attribute to your controller.

Usage:

sub object : Chained('/') NSPathPart Args(1) ActionClass('REST') {
My tags:
 
Popular tags:
 
Powered by Catalyst
Powered by MojoMojo Hosted by Shadowcat - Managed by Nordaaker