...

View Full Version : extending smarty class



magoo07
08-24-2006, 08:04 PM
hi im trying to develop my own ecommerce site and im working from a book ive just started the project and using pear and smarty which ive never used before.

ive got and error message in this setup_smarty.php file

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in c:\wamp\www\passport\include\setup_smarty.php on line 10
<?php
//reference smarty libary
require_once SMARTY_DIR.'Smarty.class.php';
//reference our configuration file
require_once 'config.inc.php';
//class that extends Smarty,used to process and display Smarty files
class Page extends Smarty
{
//constructor
function_construct()
{
//call Smarty's constructor
$this->Smarty();
//change the default template directories
$this->template_dir=TEMPLATE_DIR;
$this->compile_dir=COMPILE_DIR;
$this->config_dir=CONFIG_DIR;
}
}
?>
ive gone through the code in the book and cant see any typos can anyone see what the problem is
many thanks magoo

GJay
08-25-2006, 12:22 AM
function_construct()
{

should be:


function __construct() {

if you're using PHP 5, or


function Page() {

with PHP 4



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum