Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question extending smarty class

    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

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    PHP Code:
    function_construct()

    should be:
    PHP Code:
    function __construct() { 
    if you're using PHP 5, or
    PHP Code:
    function Page() { 
    with PHP 4


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •