John Napiorkowski > CatalystX-Syntax-Action > Syntax::Feature::CatalystAction

Download:
CatalystX-Syntax-Action-0.01.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Syntax::Feature::CatalystAction - Provide an action keyword to Catalyst Controllers

SYNOPSIS ^

    package MyApp::Web::Controller::Foo;

    use Moose;
    use namespace::autoclean;
    use syntax 'catalyst_action';

    extends 'Catalyst::Controller';

    action my_action($arg) : Path('my_special_action') Args(1)
    {
      $ctx->response->body('Look ma, no "my ($self, $ctx, $arg) = @_;"
    }

    __PACKAGE__->meta->make_immutable;

DESCRIPTION ^

This module is a syntax compatible wrapper for CatalystX::Syntax::Action. Please see that module for documentation and examples. The main reason you might wish to use this instead is that it makes it easier to install multiple syntax extensions at once. For example:

    package MyApp::Web::Controller::Foo;

    use Moose;
    use syntax qw(method function catalyst_action);

    extends 'Catalyst::Controller';

    action my_action: Action { ... }

    method my_method {
      ...
      return function($arg1, $arg2) { ... };
    }

AUTHOR ^

John Napiorkowski email:jjnapiork@cpan.org

SEE ALSO ^

Catalyst, Syntax::Feature::Method, syntax, Devel::Declare

COPYRIGHT & LICENSE ^

Copyright 2011, John Napiorkowski email:jjnapiork@cpan.org

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: