Hirdetés

Új hozzászólás Aktív témák

  • Lacces

    őstag

    Hello!

    Na ismét itt. A következő a hiba:

    Fatal error: Uncaught exception 'SmartyException' with message 'PHP5 requires you to call __construct() instead of Smarty()' in /home/lacce/tshirtshop/libs/smarty/sysplugins/smarty_internal_templatebase.php:803 Stack trace: #0 /home/lacce/tshirtshop/presentation/application.php(12): Smarty_Internal_TemplateBase->__call('Smarty', Array) #1 /home/lacce/tshirtshop/presentation/application.php(12): Smarty->Smarty() #2 /home/lacce/tshirtshop/index.php(7): Application->__construct() #3 {main} thrown in /home/lacce/tshirtshop/libs/smarty/sysplugins/smarty_internal_templatebase.php on line 803

    Most tanulom a PHP-t egy könyv alapján. És mindent úgy csináltam ahogy volt írva. De ezt itt nem igazán értem. Ráadásul ezt a fájlt csak másolni kellett, azaz smarty_internal_templatebase.php, ahol a hiba keletkezett.

    Az application.php-t és az index.php-t nekem kellett létrehozni.

    application.php:
    <?php
    // Reference Smarty library
    require_once SMARTY_DIR . 'Smarty.class.php';
    /* Class that extends Smarty, used to process and display Smarty
    files */
    class Application extends Smarty
    {
    // Class constructor
    public function __construct()
    {
    // Call Smarty's constructor
    parent::Smarty();
    // Change the default template directories
    $this->template_dir = TEMPLATE_DIR;
    $this->compile_dir = COMPILE_DIR;
    $this->config_dir = CONFIG_DIR;
    }
    }
    ?>

    index.php:
    <?php
    // Include utility files
    require_once 'include/config.php';
    // Load the application page template
    require_once PRESENTATION_DIR . 'application.php';
    // Load Smarty template file
    $application = new Application();
    // Display the page
    $application->display('store_front.tpl');
    ?>

    Mi lehet a hiba? Mit kelle módosítanom? :R

Új hozzászólás Aktív témák