[Phplib-users] Template and PHP3?
Brought to you by:
nhruby,
richardarcher
From: Peter B. <re...@f2...> - 2001-09-13 18:38:28
|
Sorry about that. I've sent the completed message below. Hi, I am having problems getting template.inc working with PHP3 - although it's probably my code at fault :-) I have the following subclass: Class Sendcard_Template extends Template { /* * private: */ function del_block($container, $handle) { $this->set_block($container, $handle); $this->set_var($handle, ""); } /***************************************************************************/ /* private: loadfile(string $varname) * varname: load file defined by varname, if it is not loaded yet. */ function loadfile($varname) { if (!isset($this->file[$varname])) { // $varname does not reference a file so return return true; } if (isset($this->varvals[$varname])) { // will only be unset if varname was created with set_file and has never been loaded // $varname has already been loaded so return return true; } $filename = $this->file[$varname]; /* use @file here to avoid leaking filesystem information if there is an error */ // $str = implode("", @file($filename)); if (floor(phpversion()) == 3) { $str = implode("", @file($filename)); } else { $str = _parseFile($filename); } if (empty($str)) { $this->halt("loadfile: While loading $varname, $filename does not exist or is empty."); return false; } $this->set_var($varname, $str); return true; } } // End Class Sendcard_Template ======================================================== When called, as per: $tpl = new Sendcard_Template($tpl_path); under PHP it generates the following error: Fatal error: Call to unsupported or undefined function sendcard_template() in /web/sites/xxxxxx/sendcard/sendcard.php on line 367 Can somebody please tell me what I'm doing wrong? I usually use PHP4, and it works fine there, but it just won't under PHP3. FYI, I've tried using PHP 3.0.9 and PHP 3.0.15. I've tried using the latest template.inc (1.8) and also 1.5. Thanks, Peter. --oOo-- Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Peter's web page - Scottish narrow gauge in 009 http://members.aol.com/reywob/ --oOo-- |