|
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 |
feti Smarty Rookie
Joined: 04 Aug 2003 Posts: 7 Location: Ohio
|
Posted: Tue Aug 05, 2003 2:18 am Post subject: Custom {sum_iferror} block function |
|
|
What I'd like to do is mimic the conditional {if} block style, but inside a custom block that accesses custom smarty variables.
I have two attributes, a param and a message. What my block function does is check if a validation error has occured on the parameter with the given name, and if so, sets the smarty variable stored in 'message' to the error message, like so:
{sum_iferror param=first_name message=message}
Error: {$message}
{/sum_iferror}
However, I want to tell smarty to ignore everything inside, or stop processing of the content if an error isn't set. Is there any way to have Smarty to skip everything from inside the function declaration?
-feti |
|
Back to top |
|
feti Smarty Rookie
Joined: 04 Aug 2003 Posts: 7 Location: Ohio
|
Posted: Tue Aug 05, 2003 2:59 am Post subject: |
|
|
Nevermind, the thought bypassed me. I just don't echo the actual content. For some reason I thought it was automatically printed.
-feti |
|
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
|