Retourner au contenu associé (entrée de forum : Nom de Variable...Variable !)
Posté par Le Gall Sébastien le 23 octobre 2008 à 21:35. En réponse au message Nom de Variable...Variable !. Évalué à 1.
include('./includes/functions.php'); print_text('index', 'index.html');
function print_text($page_name, $page){ global $tpl; //on inclue les templates include('./includes/template.inc'); $tpl = new Template('./template/'.$_SESSION['style'].'/'); $tpl->set_file('header', 'header.html'); $tpl->set_var(array( 'header_title' => 'WebGiftList', 'title' => 'Listes de cadeaux', 'style' => $_SESSION['style'], 'compteur' => $meter)); $header = $tpl->parse('result','header'); $tpl->set_file($page_name, $page); $tpl->set_var('header', $header); include('includes/config.inc.php'); //Inclusion de la page contenant les textes include('./lang/'.$LANG.'/'.$LANG.'_'.$page_name.'.php'); $c = count(${$page_name}); for ($i=0; $i<=$c; $i++){ $tpl->set_var($page_name.'_'.$i, ${$page_name}[$i]); } }
{index_0}
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: ben
Posté par Le Gall Sébastien . En réponse au message Nom de Variable...Variable !. Évalué à 1.
Index.php :
include('./includes/functions.php');
print_text('index', 'index.html');
functions.php :
function print_text($page_name, $page){
global $tpl;
//on inclue les templates
include('./includes/template.inc');
$tpl = new Template('./template/'.$_SESSION['style'].'/');
$tpl->set_file('header', 'header.html');
$tpl->set_var(array(
'header_title' => 'WebGiftList',
'title' => 'Listes de cadeaux',
'style' => $_SESSION['style'],
'compteur' => $meter));
$header = $tpl->parse('result','header');
$tpl->set_file($page_name, $page);
$tpl->set_var('header', $header);
include('includes/config.inc.php');
//Inclusion de la page contenant les textes
include('./lang/'.$LANG.'/'.$LANG.'_'.$page_name.'.php');
$c = count(${$page_name});
for ($i=0; $i<=$c; $i++){
$tpl->set_var($page_name.'_'.$i, ${$page_name}[$i]);
}
}
index.html:
{index_0}
Voila ! J'espère que ça suffira pour comprendre le problème...
En tout cas, merci de votre aide.