Apache-ClearSilver
view release on metacpan or search on metacpan
lib/Apache/ClearSilver.pm view on Meta::CPAN
$hdf;
}
sub _hdf_setValue {
my ($hdf, $key, $val) = @_;
if (ref $val eq 'ARRAY') {
my $index = 0;
for my $v (@$val) {
_hdf_setValue($hdf, "$key.$index", $v);
$index++;
}
} elsif (ref $val eq 'HASH') {
while (my ($k, $v) = each %$val) {
_hdf_setValue($hdf, "$key.$k", $v);
}
} elsif (ref $val eq 'SCALAR') {
_hdf_setValue($hdf, $key, $$val);
} elsif (ref $val eq '') {
$hdf->setValue($key, $val);
}
}
sub HDFLoadPath($$@) {
my ($cfg, $params, $arg) = @_;
my $paths = $cfg->{HDFLoadPath} ||= [];
push @$paths, $arg;
}
sub HDFFile($$@) {
my ($cfg, $params, $arg) = @_;
my $paths = $cfg->{HDFFile} ||= [];
push @$paths, $arg;
}
sub HDFSetValue($$$$) {
my ($cfg, $parms, $name, $value) = @_;
$cfg->{HDFValue}->{$name} = $value;
}
sub CSContentType($$$) {
my ($cfg, $params, $arg) = @_;
$cfg->{CSContentType} = $arg;
}
1;
__END__
=head1 NAME
Apache::ClearSilver - Apache/mod_perl interface to the ClearSilver template system.
=head1 SYNOPSIS
# add the following to your httpd.conf
PerlModule Apache::Template
# set various configuration options, e.g.
HDFLoadPath /path/to/loadpath /path/to/anotherpath
HDFFile /path/to/mydata.hdf /path/to/mydata2.hdf
HDFSetValue Foo bar
CSContentType "text/html; charset=utf-8"
# now define Apache::Clearsilver as a PerlHandler, e.g.
<Files *.cs>
SetHandler perl-script
PerlHandler Apache::Template
</Files>
=head1 DESCRIPTION
Apache::ClearSilver is Apache/mod_perl interface to the ClearSilver template system.
implementing ClearSilver CGI Kit.
=head1 CONFIGURATION
=over 4
=item HDFLoadPath
added to hdf.loadpaths.
=item HDFFile
HDF Dataset files into the current HDF object.
=item HDFSetValue
set HDF value.
=item CSContentType
set Content-Type. (default text/html)
=back
=head1 AUTHOR
Jiro Nishiguchi E<lt>jiro@cpan.orgE<gt>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 SEE ALSO
L<Apache>
ClearSilver Documentation: L<http://www.clearsilver.net/docs/>
=cut
( run in 2.261 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )