Saj
12-01-2003, 09:18 PM
Hey,
I'm working on a simple template class at the moment to incorporate with my message board, but have stumbled on a few problems.....
This is my code for the Error Template:
class ErrorTemplate {
function ErrorTemplate($Error, $MySQLError) {
return <<<HTML
<!-- My HTML -->
HTML;
}
}
And my Error Function in my actual Message Board Class:
function Error($Error, $MySQLError = '') {
require('Error.tpl.php');
$ErrorTemplate = new ErrorTemplate($Error, $MySQLError);
return false;
}
Well first off, I get this error message:
Parse error: parse error, unexpected $end in c:\web\www\php\mb\mysql class\phpWWWBoard\Error.tpl.php on line 29
Fatal error: Cannot instantiate non-existent class: errortemplate in c:\web\www\php\mb\mysql class\phpWWWBoard\phpWWWBoard.php on line 51
However, it seems that when I remove the spaces before return <<<HTML and HTML;, the error goes away, but the HTML doesnt show up. I have not been able to get any of the HTML to show up, actually, and can't see what I'm doing wrong.
Any help would be appreciated.
I'm working on a simple template class at the moment to incorporate with my message board, but have stumbled on a few problems.....
This is my code for the Error Template:
class ErrorTemplate {
function ErrorTemplate($Error, $MySQLError) {
return <<<HTML
<!-- My HTML -->
HTML;
}
}
And my Error Function in my actual Message Board Class:
function Error($Error, $MySQLError = '') {
require('Error.tpl.php');
$ErrorTemplate = new ErrorTemplate($Error, $MySQLError);
return false;
}
Well first off, I get this error message:
Parse error: parse error, unexpected $end in c:\web\www\php\mb\mysql class\phpWWWBoard\Error.tpl.php on line 29
Fatal error: Cannot instantiate non-existent class: errortemplate in c:\web\www\php\mb\mysql class\phpWWWBoard\phpWWWBoard.php on line 51
However, it seems that when I remove the spaces before return <<<HTML and HTML;, the error goes away, but the HTML doesnt show up. I have not been able to get any of the HTML to show up, actually, and can't see what I'm doing wrong.
Any help would be appreciated.