|
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 |
dldstyle Smarty n00b
Joined: 18 Aug 2010 Posts: 1
|
Posted: Wed Aug 18, 2010 12:01 pm Post subject: Récupérer une variable smarty dans un include PHP |
|
|
Bonjour à tous,
Je découvre smarty sur un projet de client qui a déjà son site développé avec.
Je dois récupérer une variable pour l'utiliser dans un include en PHP.
Mon code :
index.php
Code: | <?
$catpple = 'Infirmier';
$smarty->assign('catpple', $catpple);
$smarty->display('template.tpl');
?> |
template.tpl
Code: | …
Catégorie : {--$catpple--}
{--php--}include ('../../_admin/_includes/formulaire.inc.php');{--/php--}
|
formulaire.inc.php
Code: |
<?php
echo '<p>' .$catpple. '</p>'; // <===== NE FONCTIONNE PAS
echo '<form action="index.php" method="post" id="formulaire">
...
';
?> |
[color=red]C'est la partie echo '<p>' .$catpple. '</p>'; du dernier code qui ne marche pas.[/color] Je suis sûr que cela ne doit pas être sorcier mais je sèche
Merci pour votre aide
|
|
Back to top |
|
Gowser Smarty Pro
Joined: 19 Feb 2008 Posts: 104 Location: Nantes (France)
|
|
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
|