|
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 |
brown-hornettt Smarty n00b
Joined: 01 Mar 2007 Posts: 3
|
Posted: Sat Mar 03, 2007 4:31 pm Post subject: {IF} {ELSE} Statements |
|
|
Can smartyvalidate be used within an {if} statement ?????
I have tried like this in a submit.tpl file and cannot get validation to work.....
{if $foo == 1}
smartyvalidate statement 1 here
{else}
smartyvalidate statement 2 here
{/if}
But each of the smartyvalidate statements work if they are not inside of the {if} statement.................. |
|
Back to top |
|
brown-hornettt Smarty n00b
Joined: 01 Mar 2007 Posts: 3
|
Posted: Sun Mar 04, 2007 2:27 am Post subject: |
|
|
Does anyone have any idea if smarty can be used inside an {if} statement and if so what is the proper format, or maybe someone could direct me to where i can find more info about this |
|
Back to top |
|
JasonDS Smarty Rookie
Joined: 25 Jan 2007 Posts: 25
|
Posted: Fri Mar 09, 2007 4:09 pm Post subject: |
|
|
You're using invalid Smarty syntax, you can't use '==', you should use 'eq'
|
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
JasonDS Smarty Rookie
Joined: 25 Jan 2007 Posts: 25
|
Posted: Fri Mar 09, 2007 6:30 pm Post subject: |
|
|
You should be more respectful, not everyone knows everything, get lost dumbass |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sat Mar 10, 2007 3:34 am Post subject: |
|
|
JasonDS wrote: | You should be more respectful, not everyone knows everything, get lost dumbass |
Can we please refrain from name calling?
I don't think you needed to take that personally, JasonDS. TGKnight was correct to point you to the manual. Everyone makes mistakes but it would be best not to give advice unless you are certain that it is correct advice. In this case, it seems you never fully read the manual in regards to the answer you gave. I think TGKnight was only trying to help you learn something that didn't already know.
I've noticed that you have given some good answers here in the forums but occasionally you give some unresearched advices. Your enthusiasm is very welcome and refreshing but it would be better to either not answer if you are uncertain or better yet, to first verify the answer you are giving.
Most of all, it would mean a lot to me personally if users didn't attack one-another.
Best Regards! |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
Posted: Tue Mar 13, 2007 2:11 pm Post subject: |
|
|
JasonDS wrote: | You should be more respectful, not everyone knows everything, get lost dumbass |
... I would say 90% of the time I post something on this forum, I either know the answer by rote, or by researching the answer... I always try to provide links to the manual if possible so that the OP can learn to do a little research on their own.
It bothers me when I see someone post something that is inaccurate when the correct answer is readily available.
But you're right.. "RTFM..." was harsh.. next time I will use "RTFM!!!"
P.S. Feel free to correct me at anytime.. My pride might be bruised, but I'd rather know the right answer. _________________ Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template |
|
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
|