• [^] # Re: ben

    Posté par . En réponse au message Nom de Variable...Variable !. Évalué à 1.

    Ok... Tant pis, je vais pourrir le forum avec une tonne de code :-)

    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.