Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/10/2012, 08:39
MayLess
 
Fecha de Ingreso: septiembre-2012
Mensajes: 10
Antigüedad: 11 años, 7 meses
Puntos: 0
Recorrer array de objetos con Smarty

Hola, miren, tengo esta clase:

Código PHP:
class Pregunta {
private 
$idPregunta;
    private 
$idAsignatura;
    private 
$idCategoria;
    private 
$imagen01;
    private 
$imagen02;
    private 
$imagen03;
    private 
$pregunta;
    private 
$listaRespuesta = array();

Y sus respectivos metodos get y set.

Ademas, tengo otra que me retorna un array de objetos (Pregunta).

El problema que tengo es que cuando intento recorrerlo en el template hecho con Smarty, no me funciona. Lo hago de esta manera:

Código PHP:
{section name=mysec loop=$PREGUNTA}
{
strip}
<
div class="box">
    <
p>
        {
assign var=file value=$PREGUNTA[mysec]}
        {
$file->getPregunta}
    </
p>
</
div>
{/
strip}
{/
section
Me muestra el div, pero simplemente aparece vacio.