hi Peter,
I don't know that I can help you with Q2, but I'll have a shot at Q1.
Firstly you dont need to 'use HTML::Template' when you are already using
CGI::Application as your base. C::A loads up the H::T module for you.
What you are doing is setting the tmpl_path with C::A but then loading
the template with H::T directly so your tmpl_path is not being
associated. You can try something like this:
use base 'CGI::Application';
use CGI::Application::Plugin::DBH (qw/dbh_config dbh/);
use CGI::Application::Plugin::Session;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use strict;
use warnings;
sub cgiapp_init
{
# Set the path to the templates
.
.
.
############# notice this #############
$self->tmpl_path('/Library/WebServer/CGI-Executables/kartingdata/
templates/'); # should there be a space in here??
#######################################
}
.
.
.
sub logon
{
my ($self, @args) = @_;
############# and this ################
my $page = $self->load_tmpl('logon.tmpl');
#######################################
.
.
.
Cheers,
David
Peter Fogg wrote:
> Given this:
>
> use base 'CGI::Application';
> use CGI::Application::Plugin::DBH (qw/dbh_config dbh/);
> use CGI::Application::Plugin::Session;
> use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
> use HTML::Template;
> use strict;
> use warnings;
>
> sub cgiapp_init
> {
> # Set the path to the templates
> .
> .
> .
> ############# notice this #############
> $self->tmpl_path('/Library/WebServer/CGI-Executables/kartingdata/
> templates/');
> #######################################
> }
> .
> .
> .
> sub logon
> {
> my ($self, @args) = @_;
>
> ############# and this ################
> my $page = HTML::Template->new(filename => 'logon.tmpl');
> #######################################
> .
> .
> .
>
> I get the error ". . .Cannot open included file logon.tmpl . . ."
>
> This, however, works!
>
> use base 'CGI::Application';
> use CGI::Application::Plugin::DBH (qw/dbh_config dbh/);
> use CGI::Application::Plugin::Session;
> use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
> use HTML::Template;
> use strict;
> use warnings;
>
>
> sub cgiapp_init
> {
> # Set the path to the templates
> .
> .
> .
> # $self->tmpl_path('/Library/WebServer/CGI-Executables/kartingdata/
> templates/');
> }
> .
> .
> .
> sub logon
> {
> my ($self, @args) = @_;
>
> my $page = HTML::Template->new(filename =>
> '/Library/WebServer/CGI-Executables/kartingdata/templates/logon.tmpl');
> .
> .
> .
>
>
> ???
>
> Question 2: "use CGI::Application::Plugin::Session;" will not accept
> "(qw/-ip-match/)" but
> the non-plugin Session will. How do I set the ip match to "on" in the
> plugin?
>
> Thanks for the help.
>
> Peter -
>
>
> ---------------------------------------------------------------------
> Web Archive: http://www.mail-archive.com/[email protected]/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>