Class::DBI in Template Toolkit

Steve Rushe steve-belfastpm at deeden.co.uk
Fri Apr 26 07:14:54 CDT 2002


lo all

I was doing some TT and Class::DBI stuff last night when I came across a
slight problem. I'm sure there's a sensible solution to this, but I was
too tired last night and I'm too busy today to sort it out.

The problem is that I want to call a class method in a module from within
my template. I've created a plugin to let me access the module using the
standard "pass onto new" technique, but this of course doesn't work well
when trying to access a class method within the module. This is due to the
fact that the module will return undef with no parameters passed to new.

I could I suppose change new to return a "blank" object if called with no
parameters, but I don't really want to lose the benefit of undef for an
invalid parameter to new.

So does anyone have any ideas on how to get around this, and have I missed
something extraordinarily simple?

Steve

-- 
Steve Rushe - www.deeden.co.uk

I've given you so much rope you should have been hanging for days.



More information about the Belfast-pm mailing list