unexpected T_EXTENDS
| From: | Clive Richardson | Date: | Fri, 19 Jul 2002 09:15:26 +0000 |
| Subject: | unexpected T_EXTENDS | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5364@lists.php.net to get a copy of this message | ||
Hello,
I'm a new user of SMARTY and I'm working my way
through the on-line Smarty Manual but have hit a snag
on the 'Extended Setup' section:-
http://smarty.php.net/manual/en/installing.smarty.extended.html
It looks like a syntax error being picked up by the
parser. However, I can't figure out what the problem
is. Any suggestions? See below for information.
Thanks,
Clive
******************
Here is the output from my browser:-
Parse error: parse error, unexpected T_EXTENDS in
c:\php\includes\guestbook\setup.php on line 10
Fatal error: Cannot instantiate non-existent class:
smarty_guestbook in c:\program files\apache
group\apache2\htdocs\guestbook\index.php on line 14
Here is my Index.php:-
<html>
<head>
<title>Bonding With PHP</title>
</head>
<body>
<?php
require('guestbook/setup.php');
$smarty = new Smarty_GuestBook;
$smarty->assign('name','Ned');
$smarty->display('index.tpl');
?>
</body>
</html>
Here is my setup.php:-
<?
// load Smarty library files
define(SMARTY_DIR,'c:/php/includes/Smarty/');
require(SMARTY_DIR.'Smarty.class.php');
// a good place to load application library files,
example:
// require('guestbook/guestbook.lib.php');
Smarty_GuestBook extends Smarty {
function Smarty_GuestBook() {
// Class Constructor. These automatically get set
with each new instance.
$this->template_dir = 'c:/program files/apache
group/apache2/smarty/templates/';
$this->compile_dir = 'c:/program files/apache
group/apache2/smarty/templates_c/';
$this->config_dir = 'c:/program files/apache
group/apache2/smarty/configs/';
$this->cache_dir = 'c:/program files/apache
group/apache2/smarty/cache/';
$this->caching = true;
$this->assign('app_name','Guest Book');
}
}
?>
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com