Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problème avec la configuration avancée

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
ji_louis
Smarty Rookie


Joined: 27 Jan 2011
Posts: 5
Location: Saint Malo / Paris

PostPosted: Thu Jan 27, 2011 9:24 am    Post subject: Problème avec la configuration avancée Reply with quote

Bonjour,

Je suis pas à pas les exemples donnés par la doc (http://www.smarty.net/docsv2/fr/installing.smarty.basic.tpl) et ça marche bien, mais quand je passe à l'exemple de la configuration avancée (adaptée à mon cas), ça plante, et je ne comprends pas pourquoi!

Code:
//message d'erreur

<b>Fatal error</b>:  Uncaught exception 'SmartyException' with message 'Please use parent::__construct() to call parent constuctor' in D:\chez_moi\Mes documents\website\Smarty-3.0.6\libs\Smarty.class.php:779
Stack trace:
#0 [internal function]: Smarty->__call('Smarty', Array)
#1 D:\chez_moi\Mes documents\website\workspace\SM2\config\setup.php(20): Smarty_sm2->Smarty()
#2 D:\chez_moi\Mes documents\website\workspace\SM2\index.php(6): Smarty_sm2->Smarty_sm2()
#3 {main}
  thrown in D:\chez_moi\Mes documents\website\Smarty-3.0.6\libs\Smarty.class.php on line 779

Code:
//mon index.php

<?php
require('config/setup.php');
$smarty = new Smarty_sm2();

$smarty->assign('name','Ned');

$smarty->display('index.tpl');
?>

Code:
//mon setup.php

<?php
define('SMARTY_DIR', 'D:/chez_moi/Mes documents/website/Smarty-3.0.6/libs/');
define ('NewAppli_dir', 'D:/chez_moi/Mes documents/website/Smarty-3.0.6/SM2/');

// charge la librairie Smarty
require(SMARTY_DIR . 'Smarty.class.php');

class Smarty_sm2 extends Smarty {

    function Smarty_sm2() {
      parent::__construct();
      // Constructeur de la classe.
      // Appelé automatiquement à l'instanciation de la classe.
      $this->Smarty();
      
      $smarty->template_dir = NewAppli_dir.'templates/';
      $smarty->compile_dir = NewAppli_dir.'templates_c/';
      $smarty->config_dir = NewAppli_dir.'configs/';
      $smarty->cache_dir = NewAppli_dir.'cache/';
      
      $this->caching = true;
      $this->assign('app_name', 'couteau suisse de SM2');
      $smarty->assign('name','Ned');
   }
}
?>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP