]>
Dogcows Code - chaz/p5-CGI-Ex/blob - lib/CGI/Ex/Template.pm
1 package CGI
::Ex
::Template
;
4 use vars
qw(@INCLUDE_PATH $CONTENT_SUBDIR);
10 $CONTENT_SUBDIR ||= 'content';
12 ###----------------------------------------------------------------###
16 my $args = ref($_[0]) ? shift : {@_};
18 $args->{INCLUDE_PATH
} ||= \
@INCLUDE_PATH;
20 return $class->SUPER::new
($args);
24 my $self = ref($_[0]) ? shift : shift-
>new;
27 ### force the content to have a .html prefix
29 $in .= '.html' if $in !~ /\.\w+$/;
32 ### prepend "content" dir as needed
33 if (! ref($in) # not a scalar ref or a file glob
34 && $in =~ m
|^\w
+(\
.\w
+)?(/\w
+(\
.\w
+)?)*$| # not an absolute filename
35 && index($in, $CONTENT_SUBDIR) == -1) {
36 $in = $CONTENT_SUBDIR .'/'. $in;
39 return $self->SUPER::process
($in, @_);
42 ###----------------------------------------------------------------###
45 my $self = ref($_[0]) ? shift : shift-
>new;
53 my $status = $self->process($in, $form, \
$out) || die $Template::ERROR
;
56 &CGI
::Ex
::Fill
::form_fill
(\
$out, $fill) if $fill && ! $self->{no_fill
};
62 my $self = ref($_[0]) ? shift : shift-
>new;
65 my $fill = shift || $form;
67 &CGI
::Ex
::content_type
();
68 print $self->out($in, $form, $fill);
71 ###----------------------------------------------------------------###
79 CGI::Ex::Template - Beginning interface to Templating systems - for they are many
89 Paul Seamons <perlspam at seamons dot com>
This page took 0.046908 seconds and 5 git commands to generate.