|
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 |
feelexit Smarty Rookie
Joined: 06 Dec 2004 Posts: 29
|
Posted: Mon Jan 22, 2007 12:39 pm Post subject: how to write this if statement in smarty ? |
|
|
{if file_exists('usrimage/iconthumb/' + $smarty.session.uname + '.jpg')}
something wrong this if statement.
$smarty.session.uname is 'admin'
if i use {if file_exists('usrimage/iconthumb/admin.jpg')} , i got right image back.
I want know how to rewrite it , so i can have smarty variable in the if statement. |
|
Back to top |
|
Hielke Hoeve Smarty Elite
Joined: 06 Jan 2006 Posts: 406 Location: Netherlands
|
Posted: Mon Jan 22, 2007 9:46 pm Post subject: |
|
|
you cant`t use `+ $smarty.session.uname +`. $smarty probably isn`t a valid variable within smarty, as in you didn`t add it to smarty using ->assign(). assigning a new variable with some user information for this sort of information is often the easiest. _________________ Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net> |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
feelexit Smarty Rookie
Joined: 06 Dec 2004 Posts: 29
|
Posted: Sat Jan 27, 2007 12:08 pm Post subject: |
|
|
TGKnIght, thanx alot. got it work now. |
|
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
|