|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
pendragon509 Smarty n00b
Joined: 11 Oct 2005 Posts: 3
|
Posted: Tue Oct 11, 2005 2:14 pm Post subject: include |
|
|
Bonjour, je voudrais inclure un fichier template dans un autre fichier.
J'ai bien essayé {include file="cnt_bloc_info.tpl"}
mais voici l'erreur obtenue :
Code: | Warning: Smarty error: unable to read resource: "cnt_bloc_info.tpl" in /bo/lib/smarty/Smarty.class.php on line 1121 |
Merci d'avance |
|
Back to top |
|
Pim Smarty n00b
Joined: 13 Oct 2005 Posts: 2
|
Posted: Thu Oct 13, 2005 6:04 pm Post subject: |
|
|
Salut,
A première vue, je dirais que ton fichier cnt_bloc_info.tpl ne se trouve pas dans le répretoire $template_dir.
Autrement, en ce qui me concerne, pour inclure des templates dans d'autres, je préfère utiliser la méthode fetch, qui permet de récupérer le résultat de la compilation d'un template dans une variable. Cette variable, je l'assigne à mon template et je l'affiche où je veux ensuite. Je ne sais pas si c'est plus rapide, plus pratique, plus propre, plus n'importe quoi, mais ça marche... |
|
Back to top |
|
|
|
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
|