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

Flexible messages

 
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 -> Add-ons
View previous topic :: View next topic  
Author Message
nexor
Smarty n00b


Joined: 27 Jul 2004
Posts: 3

PostPosted: Tue Jul 27, 2004 1:44 pm    Post subject: Flexible messages Reply with quote

Can I make something like that:

{validate ... message='$blah' }
?


I'm making muli-language site, so messages have to be differ for different languages...

Thanks
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jul 27, 2004 3:03 pm    Post subject: Reply with quote

It is a Smarty function, so normal template quoting syntax applies:

{validate ... message=$blah}

{validate ... message="foo $blah bar"}
Back to top
View user's profile Send private message Visit poster's website
nexor
Smarty n00b


Joined: 27 Jul 2004
Posts: 3

PostPosted: Tue Jul 27, 2004 6:54 pm    Post subject: Reply with quote

Thanks, but...

my code looks like that:

{validate field="login" criteria="notEmpty" message="aaa $login_msg aaa"}
Login: <INPUT type="text" name="login"><br>
Pass: <INPUT type="password" name="pass"><br>
{$login_msg}

If I leave input 'login' empty I can see only 'aaa aaa' text. Few lines below {$login_msg} text is displayed corerctly. Am I the only one with such a problem ?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jul 27, 2004 7:58 pm    Post subject: Reply with quote

I just ran a test, it looked fine to me... It could be that $login_msg isn't assigned the first time the form is drawn so the message in the session data ends up empty.
Back to top
View user's profile Send private message Visit poster's website
nexor
Smarty n00b


Joined: 27 Jul 2004
Posts: 3

PostPosted: Tue Jul 27, 2004 9:06 pm    Post subject: Reply with quote

Oh, man you were right ! I were assignig it just before displaying wrong validated form...

Thank you very much !
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 -> Add-ons 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