|
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: Thu Sep 03, 2009 1:59 pm Post subject: Visualizar variable PHP |
|
|
En un archivo PHP tengo la definición de la ruta donde se encuentran mis imagenes.
<?php
define('DIR_IMAGES', 'imagen/logos/');
?>
Si quiero visualizar la imagen utlizando PHP la sentencia sería:
echo "<img src='" . DIR_IMAGES . "logo.jpg' />"; Y mi imagen se muestra.
Pero si quiero visualizarlo utilizando Smarty, cómo sería la sentencia??
|
|
Back to top |
|
Davod Smarty Rookie
Joined: 29 Sep 2009 Posts: 21
|
Posted: Tue Sep 29, 2009 1:12 am Post subject: |
|
|
Trade pero respondido:
<img src="{$smarty.const.DIR_IMAGES}logo.jpg" />
Recuerda que las Constantes se obtienen en la Plantilla mediante $smarty.const (las Cosntantes son Globales!!!) |
|
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
|