The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Leyland::Controller - Leyland controller base class

SYNOPSIS

        # used internally

DESCRIPTION

This Moo role describes how Leyland controllers are to be created. For information about creating controllers, please see Leyland::Manual::Controllers.

CLASS ATTRIBUTES

prefix

The prefix of the controller. Defaults to the empty string (denoting a root controller).

routes

A Tie::IxHash object with all the controller's routes.

CLASS METHODS

add_route( $method, $regex, \&code )

Receives an HTTP request method, a regular expression for path matching, and a subroutine reference that together describe a route, and adds the route to the controller's "routes" list.

set_prefix()

Sets the prefix for all routes in the controller.

METHODS MEANT TO BE OVERRIDDEN

The following methods are meant to be overridden by consuming classes (i.e. controllers). For information on their purpose, see Leyland::Manual::Controllers.

auto( $c )

Provides Leyland controllers with a default auto() method that doesn't do anything. Controllers are expected to override this.

pre_route( $c )

Provides Leyland controllers with a default pre_route() method that doesn't do anything.

pre_template( $c, $tmpl_name, [ \%context, $use_layout ] )

Provides Leyland controllers with a default pre_template() method that doesn't do anything.

post_route( $c, $ret )

Provides Leyland controllers with a default post_route() method that doesn't do anything.

AUTHOR

Ido Perlmuter, <ido at ido50.net>

BUGS

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

SUPPORT

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

        perldoc Leyland::Controller

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2010-2014 Ido Perlmuter.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.