]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - samples/app/app1/lib/App1.pm
CGI::Ex 2.24
[chaz/p5-CGI-Ex] / samples / app / app1 / lib / App1.pm
diff --git a/samples/app/app1/lib/App1.pm b/samples/app/app1/lib/App1.pm
new file mode 100644 (file)
index 0000000..a86c1a0
--- /dev/null
@@ -0,0 +1,46 @@
+package App1;
+
+=head1 NAME
+
+App1 - base class for use in app1.pl
+
+=cut
+
+use strict;
+use warnings;
+use base qw(CGI::Ex::App);
+use FindBin qw($Bin);
+use CGI::Ex::Dump qw(debug);
+
+###----------------------------------------------------------------###
+
+# preload these so that their load times don't affect the dump_history times
+use CGI;
+use Template::Alloy qw(Parse Play Compile);
+
+sub post_navigate {
+    my $self = shift;
+    debug $self->dump_history
+        if ! $self->{'no_history'};
+}
+
+###----------------------------------------------------------------###
+
+sub load_conf       { 1 } # let configuration be read from a file
+sub conf_file       { "$Bin/app1.yaml" }
+sub conf_validation { {path => {required => 1, max_values => 100}} }
+
+sub allow_morph     { 1 } # allow each step to be in a separate file
+
+sub name_module     { "" } # allow content files to be in /tt/ directory directly
+sub template_path   { "$Bin/tt" }
+sub template_args   { {COMPILE_DIR => "/tmp/tt/app1.cache"} }
+
+# if we want automatic javascript validation, and we have overridden the path,
+# we need to give the script a way to find the validate.js
+sub js_uri_path { (my $path = $ENV{'SCRIPT_NAME'}) =~ s|[^/]+$|js.pl|; $path }
+
+# setting this instructs the flow to continue until a step does not have data
+sub validate_when_data { 1 }
+
+1;
This page took 0.016737 seconds and 4 git commands to generate.