[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] CGI::Application::Plugin::Attributes developer release


I have a developer release of my Attributes plugin up.  The plugin
takes the PATH_INFO and dispatches the requests based on the
attributes you've setup in your class.  This is very similar to how
Catalyst works.  This plugin should't break the default behavoir of
cgi-app.  So you should be able to intermix both approaches.

The is a developer release so use in production at your own risk. 
However I don't think the interface will change much.  It's not on
CPAN yet, so you have to get it from here:

http://home.comcast.net/~jaywhy2/plugin-attributes.tar.gz

Here is a short example, check the perldoc for a more thorough example:

sub setup {
        my $self = shift;
        $self->mode_param('test_rm');
        $self->run_modes(
                basic_runmode => 'basic_runmode'
        );
}

sub basic_runmode {
}

# http://example.com/myapp.cgi/products/this/is/optional/and/stored/in/snippets/
sub product : Path('products/') {
        my $self = shift;
        my($category, $product) = $self->snippets();
}

# http://example.com/myapp.cgi/products/music/product/
sub music : Path('products/music/') {
        my $self = shift;
        my $product = $self->snippets();
}

# http://example.com/myapp.cgi/products/music/beatles/
sub beatles : Regex('^/products/music/beatles\/?')  {
        my $self = shift;
}

I'd love feedback, patches, or whatever.

--
Jason Yates
suppressed

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.