Daisuke Maki > Pickles > Pickles::WebApp

Download:
Pickles-0.10.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Pickles::WebApp - Pickles WebApp base class.

SYNOPSIS ^

  package MyApp;
  
  use strict;
  use warnings;
  use parent 'Pickles::WebApp';
   
  1;
  
  __END__

MyApp.psgi

  use strict;
  use MyApp;
  use Plack::Builder;
  
  my $app = MyApp->new->handler;
  builder {
      $app;
  };

METHODS ^

Class->new

returns a new WebApp object.

$webapp->handler

returns a PSGI application sub-ref.

$webapp->appname

returns a application name.

$webapp->setup_config

returns a config object. if you'd like to use custom config object, override this method.

$webapp->setup_dispatcher

returns a dispatcher object. if you'd like to use custom dispatcher object, override this method.

$webapp->get_routes_file

returns a routes file which is used by dispatcher. the default value is $config->path_to('etc/routes.pl').

$webapp->setup_container

returns a container object if you'd like to use custom container object, override this method.

$webapp->get_container_file

returns a profile file which is used by container. the default value is $config->path_to('etc/container.pl').

CLASS VARIABLES ^

The following class variables specify component classes. Omit the $self->appname prefix from the class name.

    # MyApp::Config
    MyApp->config_class('Config');

    # MyApp::Config::JSON
    MyApp->config_class('Config::JSON');

if you want to use fully qualified class name, use plus sign prefix.

    # Foo::Config
    MyApp->config_class('+Foo::Config');

MyApp->context_class

default value is Context

MyApp->config_class

default value is Config

MyApp->dispatcher_class

default value is Dispatcher

MyApp::Context->container_class

default value is Container

AUTHOR ^

Tomohiro Ikebe <ikebe {at} livedoor.jp>

SEE ALSO ^

Pickles::Context

LICENSE ^

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

syntax highlighting: