WebNano::Controller - WebNano Controller
version 0.004
This is the WebNano base controller. It's handle method dispatches the request to appropriate action method or to a next controller.
The action method should return a string containing the HTML page, a Plack::Response object or a code ref.
package MyApp::Controller; use Moose; use MooseX::NonMoose; extends 'WebNano::Controller'; has '+url_map' => ( default => sub { { 'Mapped Url' => 'mapped_url' } } ); sub index_action { my $self = shift; return $self->render( 'index.tt' ); } sub mapped_url { 'This is the mapped url page' } 1;
This is a class method - it receives the arguments, creates the controller object and then uses it's local_dispatch method.
Should return a Plack::Response object, a string containing the HTML page, a code ref or undef (which is later interpreted as 404).
Renders a template.
Finds the method to be called for a given path and dispatches to it.
Plack::Reqest made from env
By default returns the DEBUG flag from the application. When this returns true then some additional logging is directed to STDOUT.
true
A hash that is used as path part to method map.
Links back to the application object.
PSGI environment
Zbigniew Lukasiak <zby@cpan.org>
This software is Copyright (c) 2010 by Zbigniew Lukasiak <zby@cpan.org>.
This is free software, licensed under:
The Artistic License 2.0
To install WebNano, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebNano
CPAN shell
perl -MCPAN -e shell install WebNano
For more information on module installation, please visit the detailed CPAN module installation guide.