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

probleme d'affichage de variables à partir du header

 
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
majin
Smarty n00b


Joined: 26 Aug 2011
Posts: 2

PostPosted: Fri Aug 26, 2011 8:48 am    Post subject: probleme d'affichage de variables à partir du header Reply with quote

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
Code:

{$test}


merci à tous
Back to top
View user's profile Send private message
majin
Smarty n00b


Joined: 26 Aug 2011
Posts: 2

PostPosted: Fri Aug 26, 2011 10:51 am    Post subject: Reply with quote

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
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