loadTemplatefile() has me confused...
Posted: Fri Sep 04, 2009 9:27 pm
I am new to php, so really need some advice on a problem I am encountering!
I am using a script found in a book on PHP & MySQL, and am getting errors at one point:
The code is:
Where:
D_TEMPLATES = "/usr/local/apache2/htdocs/OrcaTools/templates/"
T_SKELETON = "orcatools.tpl"
The error I get:
This seems to indicate that /usr/local/apache2/htdocs/OrcaTools/templates/orcatools.tpl does not exist - and yet it IS in the folder OrcaTools/templates/...
I've tried specifically calling using the file name - both the short & long versions, I still get the same errors.
What am I missing here?
I am using a script found in a book on PHP & MySQL, and am getting errors at one point:
The code is:
Code: Select all
function orcatoolsTemplate($pageBody, $pageTitle = P_TITLE)
{
$this->template = $this->HTML_Template_ITX(D_TEMPLATES);
$this->loadTemplatefile(T_SKELETON, true, true); //this is where the error occurs
$this->setVariable("TITLE", $pageTitle);
$this->addBlockFile("PAGE_BODY", "pageBody", "{$pageBody}");
}
D_TEMPLATES = "/usr/local/apache2/htdocs/OrcaTools/templates/"
T_SKELETON = "orcatools.tpl"
The error I get:
Code: Select all
[PHP Error 20090904185159]WARNING on line 914 in C:\xampp\php\PEAR\HTML\Template\IT.php.
[PHP Error 20090904185159]Error: "fopen(/usr/local/apache2/htdocs/OrcaTools/templates/orcatools.tpl) [function.fopen]: failed to open stream: No such file or directory" (error #2).
[PHP Error 20090904185159]Client IP: ::1
UNHANDLED ERROR on line 915 in C:\xampp\php\PEAR\HTML\Template\IT.php.
[PHP Error 20090904185159]Error: "Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context" (error #2048).
[PHP Error 20090904185159]Client IP: ::1
UNHANDLED ERROR on line 993 in C:\xampp\php\PEAR\HTML\Template\IT.php.
[PHP Error 20090904185159]Error: "Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context" (error #2048).
[PHP Error 20090904185159]Client IP: ::1
I've tried specifically calling using the file name - both the short & long versions, I still get the same errors.
What am I missing here?