]> Dogcows Code - chaz/p5-CGI-Ex/blob - samples/app/app1/lib/App1.pm
CGI::Ex 2.24
[chaz/p5-CGI-Ex] / samples / app / app1 / lib / App1.pm
1 package App1;
2
3 =head1 NAME
4
5 App1 - base class for use in app1.pl
6
7 =cut
8
9 use strict;
10 use warnings;
11 use base qw(CGI::Ex::App);
12 use FindBin qw($Bin);
13 use CGI::Ex::Dump qw(debug);
14
15 ###----------------------------------------------------------------###
16
17 # preload these so that their load times don't affect the dump_history times
18 use CGI;
19 use Template::Alloy qw(Parse Play Compile);
20
21 sub post_navigate {
22 my $self = shift;
23 debug $self->dump_history
24 if ! $self->{'no_history'};
25 }
26
27 ###----------------------------------------------------------------###
28
29 sub load_conf { 1 } # let configuration be read from a file
30 sub conf_file { "$Bin/app1.yaml" }
31 sub conf_validation { {path => {required => 1, max_values => 100}} }
32
33 sub allow_morph { 1 } # allow each step to be in a separate file
34
35 sub name_module { "" } # allow content files to be in /tt/ directory directly
36 sub template_path { "$Bin/tt" }
37 sub template_args { {COMPILE_DIR => "/tmp/tt/app1.cache"} }
38
39 # if we want automatic javascript validation, and we have overridden the path,
40 # we need to give the script a way to find the validate.js
41 sub js_uri_path { (my $path = $ENV{'SCRIPT_NAME'}) =~ s|[^/]+$|js.pl|; $path }
42
43 # setting this instructs the flow to continue until a step does not have data
44 sub validate_when_data { 1 }
45
46 1;
This page took 0.037094 seconds and 4 git commands to generate.