Using variable in tpl file

Discussion in 'Programming' started by piropeator, Jul 15, 2010.

  1. #1
    I have this code:

    Main.php
    ======
    $dao = new PersonaDAO();
    $lista = $dao->listar();
    $tpl = new Plantilla();
    $tpl->assign("lista", $lista);
    $tpl->display('view_array.tpl.php');
    
    PHP:
    and this other code:

    view_array.tpl.php
    ==============
    <tr><td><input type="checkbox" name="seleccion[]"
    value="<?php $lista[i]->idusuario?>">{$lista[i]->nom} {$lista[i]->appat} {$lista[i]->apmat}</td></tr>
    
    HTML:
    I want to put a item from array in the checkbox value (value="arrayvalue"). How I do that?
     
    piropeator, Jul 15, 2010 IP