CatalystX::self - A customized self for Catalyst controllers


CatalystX-self documentation  | view source Contained in the CatalystX-self distribution.

Index


NAME

Top

CatalystX::self - A customized self for Catalyst controllers

VERSION

Top

Version 0.01

DESCRIPTION

Top

This is a very simple but handy module that shifts some of bits around from self to allow for an easier usage with (and with in) Catalyst controllers.

    package MyApp::Foo;

    use parent 'Catalyst::Controller';
    use CatalystX::self;

    sub bar : Local {
        my ($some,$params) = args;
        self->action_for('name');
        catalyst->response->body('Hello World');
    }

    ...

What if I don't like the names of these block words?

Simple! Since self and this module utilize Sub::Exporter you may rename the methods as you see fit. Here is an example that renames the args block word into some else and the catalyst block word into the more common and shorter 'c'.

    package MyApp::LostShoes;

    use parent 'Catalyst::Controller';
    use CatalystX::self (
        catalyst => { -as => 'c' },
        args => { -as => 'gnargles' },
        self => { -as => 'this' }
    );

    sub bar : Local {
        this->{shoe} = gnargles;
        c->res->body($this->{shoe});
    }

    ...

You may also use the '-as' import renaming trick to do "aliases".

    use CatalystX::self (
        catalyst => { -as => 'c' },
        '-all'
    );

Now we have both 'catalyst' and 'c' block words.

EXPORT

Top

self

See self in self

args

Returns properly shifted args in self for Catalyst controllers

catalyst

Returns Catalyst object. Also known as the second argument in a Catalyst controller method.

AUTHOR

Top

Jason M. Mills, <jmmills at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-catalystx-self at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-self. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc CatalystX::self




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-self

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/CatalystX-self

* CPAN Ratings

http://cpanratings.perl.org/d/CatalystX-self

* Search CPAN

http://search.cpan.org/dist/CatalystX-self

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


CatalystX-self documentation  | view source Contained in the CatalystX-self distribution.