X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FSimple.pm;h=ae7f8463c00c5fc1f5d4f812bfd57e1416fe7a50;hb=beb7eb96f1ae4dc19c3ed4f38359c7549ae62b99;hp=d5ca0e2997554843189189fe1ecc5bb3a4a1a7ee;hpb=3da8f8c40ba66a5035e74e0888e991043e2092bd;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Simple.pm b/lib/Web/Simple.pm index d5ca0e2..ae7f846 100644 --- a/lib/Web/Simple.pm +++ b/lib/Web/Simple.pm @@ -6,7 +6,7 @@ use warnings::illegalproto (); use Moo (); use Web::Dispatch::Wrapper (); -our $VERSION = '0.020'; +our $VERSION = '0.026'; sub import { my ($class, $app_package) = @_; @@ -246,11 +246,13 @@ route is to provide a Dancer like key-value list: ( '.html' => sub { response_filter { $self->render_zoom($_[0]) } }, '/user/*' => sub { $self->users->get($_[1]) }, + 'POST + %*' => 'handle_post', ) } This can be useful in situations where you are generating a dispatch table -programmatically, where setting a subroutines protoype is difficult. +programmatically, where setting a subroutines protoype is difficult. Note that +in the example above, C is a method that would be called. to render a user object to HTML, if there is an incoming URL such as: @@ -515,9 +517,9 @@ would write: sub (?page=&order_by~) { my ($self, $page, $order_by) = @_; return unless $page =~ /^\d+$/; - $page ||= 'id'; + $order_by ||= 'id'; response_filter { - $_[1]->search_rs({}, $p); + $_[1]->search_rs({}, { page => $page, order_by => $order_by }); } } @@ -860,6 +862,10 @@ Andrew Rodland (hobbs) Robert Sedlacek (phaylon) +Hakim Cassimally (osfameron) + +Karen Etheridge (ether) + =head1 COPYRIGHT Copyright (c) 2011 the Web::Simple L and L