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

Custom {sum_iferror} block function

 
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 -> General
View previous topic :: View next topic  
Author Message
feti
Smarty Rookie


Joined: 04 Aug 2003
Posts: 7
Location: Ohio

PostPosted: Tue Aug 05, 2003 2:18 am    Post subject: Custom {sum_iferror} block function Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
feti
Smarty Rookie


Joined: 04 Aug 2003
Posts: 7
Location: Ohio

PostPosted: Tue Aug 05, 2003 2:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
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 -> General 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