|
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 |
majin Smarty n00b
Joined: 26 Aug 2011 Posts: 2
|
Posted: Fri Aug 26, 2011 8:48 am Post subject: probleme d'affichage de variables à partir du header |
|
|
Bonjour à tous,
Depuis peu je tente de créer un petit site e-commerce grâce à prestashop, je me suis donc mis à smarty.
Mon problème est que lorsque j'assigne une variable dans le fichier header.php et que je l'affiche dans le header.tpl, celle-ci s'affiche correctement dans le header dans une url de page crée ex: prestashop/test.php ca marche nickel, mais jamais dans les pages initialement prévues de prestashop comme category.php ou product.php.
pourquoi ? et d'où vient cette restriction ?
header.php
Code: |
global $smarty;
$smarty->assign('test', 'un test');
$controller = new FrontController();
$controller->displayHeader();
|
quelque part dans le header.tpl
merci à tous |
|
Back to top |
|
majin Smarty n00b
Joined: 26 Aug 2011 Posts: 2
|
Posted: Fri Aug 26, 2011 10:51 am Post subject: |
|
|
Dans la fonction displayheader() de frontcontroller.php on peut assigner des variables pour le header.tpl.
Cependant cela ne repond pas à ma question qui est pourquoi une variable assignée dans le header.php ne s'affiche pas dans les pages possédant un controller.
si quelqu'un peut m'expliquer, ce serait cool car je souhaiterais quand même comprendre ! |
|
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
|