Chris Weyl > CatalystX-Alt-Routes-0.002-TRIAL > CatalystX::Alt::Routes

Download:
CatalystX-Alt-Routes-0.002-TRIAL.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.002   Source  

NAME ^

CatalystX::Alt::Routes - A DSL for declaring controller paths

VERSION ^

version 0.002

SYNOPSIS ^

    package MyApp::Controller::Foo;

    use Moose;
    use namespace::autoclean;
    use CatalystX::Alt::Routes;

    extends 'Catalyst::Controller';

    # aka: sub index : Path(q{}) Args(0) { ... }
    index_action { ... do something indexy here ... };

    public list
        => args 1
        => template 'other_list.tt2'
        => sub {
            my ($self, $c) = @_;

            ... something listy here ...
    };


    private something

DESCRIPTION ^

This package exports sugar that allows paths to be declared without having to hew to any of the requirements of attributes. Note that this is an _alternate_ way to declare paths; you can still use the standard approach without fear or reprisal.

We provide common shortcuts to common "special" actions (index, default, etc) as well as some helpers for commonly-used packages.

SPECIAL ACTIONS ^

These all take one argument, a coderef; e.g.

    index_action { ... do something indexy ... };

index_action

default_action

begin_action

end_action

auto_action

ACTIONS ^

public

private

global

ACTION PARAMETERS ^

Probably not the best name for this.

NAVIGATION/MENU PARAMETERS ^

We also include support for defining menu attributes that can be used by Catalyst::Plugin::Navigation.

BEGIN BLOCKS ^

It's good practice to wrap any "extends" in your controller classes -- essential if you're using the standard approach of method attributes to define your routes.

If you're using this package exclusively to define actions, you do not need to use a BEGIN block. Note I'm not recommending this, just stating that it's possible -- and if something breaks, you get to keep all the pieces :)

SEE ALSO ^

This package is largely inspired by (and steals parts of) CatalystX::Routes.

BUGS ^

All complex software has bugs lurking in it, and this module is no exception.

Please report any bugs to "bug-CatalystX-Alt-Routes@rt.cpan.org", or through the web interface at <http://rt.cpan.org>.

Patches and pull requests through GitHub are most welcome; our page and repo (same URI):

    https://github.com/RsrchBoy/catalystx-alt-routes

AUTHOR ^

Chris Weyl <cweyl@alumni.drew.edu>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Chris Weyl.

This is free software, licensed under:

  The GNU Lesser General Public License, Version 2.1, February 1999
syntax highlighting: