Bonjour,
Je débute en PHP et je découvre Smarty et ses tutos.
Mon souci :
J'arrive à afficher une page se trouvant à la racine du site (index.php), mais j'ai un message d'erreur quand je veux afficher une page dans un sous-dossier (1/1.php).
Warning: Smarty error: unable to read resource: "test.tpl" in C:\xampp\htdocs\Test_Smarty\Smarty\Smarty.class.php on line 1092
Une ame charitable pour m'aider à lever cette incompréhension ??
Arborescence du site :
index.php
1.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 // Inclusion de la librairie require_once('./Smarty/Smarty.class.php'); // Instanciation d'un l'objet Smarty $oSmarty = new Smarty(); // Affecter la valeur "Bonjour le monde" à la varaible SMARTY 'hello_world' $oSmarty->assign('Titre_Page', 'Test_Smarty'); // Affecter la valeur "Bonjour le monde" à la varaible SMARTY 'hello_world' $oSmarty->assign('hello_world', 'Bonjour le monde'); // Affichage du template après compilation $oSmarty->display('test.tpl');
Merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 // Inclusion de la librairie require_once('../Smarty/Smarty.class.php'); // Instanciation d'un l'objet Smarty $oSmarty = new Smarty(); // Affecter la valeur "Bonjour le monde" à la varaible SMARTY 'hello_world' $oSmarty->assign('Titre_Page', 'Test_Smarty'); // Affecter la valeur "Bonjour le monde" à la varaible SMARTY 'hello_world' $oSmarty->assign('hello_world', 'Page 1 sous-dossier'); // Affichage du template après compilation $oSmarty->display('test.tpl');
Je voulais poster dans le forum Smarty, raté
Partager