|
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 |
piropeator Smarty Rookie
Joined: 31 Oct 2007 Posts: 26
|
Posted: Wed Oct 31, 2007 1:23 pm Post subject: Plantillas Smarty Con Php |
|
|
Estoy utilizando Plantillas Smarty con PHP.
En mi base de datos tengo un campo imagen que contiene el nombre de una imagen (por ejemplo: florero.jpg), ese campo lo asigno a la plantilla smarty dentro de un loop : ( {$lista[i]->imagen} )
La foto está en mi root en una carpeta /img según la siguiente distribución:
Proyecto ---------------> mi host
\----img ---------------> Aquí están mis imagenes
\----lib
\----\----Smarty-2.6.14
\----plantillas
\----\----templates
\----\----\----displayar.tpl --> desde aquí quiero visualizar la imagen
\----\----templates_c
En lugar de la imagen aparece una "X" como cuando la ruta está mal dada.
Probé poniendo la ruta dentro de la etiqueta ásí:
<img src="$lista[i]->imagen" />
<img src="/img/$lista[i]->imagen" /> ó
<img src="../$lista[i]->imagen" />
Me falta configurar algo más?? |
|
Back to top |
|
piropeator Smarty Rookie
Joined: 31 Oct 2007 Posts: 26
|
Posted: Fri Nov 02, 2007 1:00 pm Post subject: SOLUCION!! ( Yo mismo ) |
|
|
Estuve revisando nuevamente mi código y ya funciona.
Coloco aquí la sentencia correcta:
<img src="imagen/{$lista[i]->imagen}" />
Al parecer eran las llaves el problema. No?
Saludos a todos los Smartianos.
|
|
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
|