Matt S Trout > Web-Simple > Web::Simple::Role

Download:
Web-Simple-0.030.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  5
Open  0
View/Report Bugs
Module Version: 0.029   Source  

NAME ^

Web::Simple::Role - Define roles for Web::Simple applications

SYNOPSIS ^

  package MyApp;
  use Web::Simple;
  with MyApp::Role;

  sub dispatch_request { ... }

and in the role:

  package MyApp::Role;
  use Web::Simple::Role;

  around dispatch_request => sub {
    my ($orig, $self) = @_;
    return (
      $self->$orig,
      sub (GET + /baz) { ... }
    );
  };

Now MyApp can also dispatch /baz

AUTHORS ^

See Web::Simple for authors.

COPYRIGHT AND LICENSE ^

See Web::Simple for the copyright and license.

syntax highlighting: