Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Visualizar variable PHP

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
piropeator
Smarty Rookie


Joined: 31 Oct 2007
Posts: 26

PostPosted: Thu Sep 03, 2009 1:59 pm    Post subject: Visualizar variable PHP Reply with quote

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??

Shocked
Back to top
View user's profile Send private message
Davod
Smarty Rookie


Joined: 29 Sep 2009
Posts: 21

PostPosted: Tue Sep 29, 2009 1:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP