|
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 |
nexor Smarty n00b
Joined: 27 Jul 2004 Posts: 3
|
Posted: Tue Jul 27, 2004 1:44 pm Post subject: Flexible messages |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jul 27, 2004 3:03 pm Post subject: |
|
|
It is a Smarty function, so normal template quoting syntax applies:
{validate ... message=$blah}
{validate ... message="foo $blah bar"} |
|
Back to top |
|
nexor Smarty n00b
Joined: 27 Jul 2004 Posts: 3
|
Posted: Tue Jul 27, 2004 6:54 pm Post subject: |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jul 27, 2004 7:58 pm Post subject: |
|
|
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 |
|
nexor Smarty n00b
Joined: 27 Jul 2004 Posts: 3
|
Posted: Tue Jul 27, 2004 9:06 pm Post subject: |
|
|
Oh, man you were right ! I were assignig it just before displaying wrong validated form...
Thank you very much ! |
|
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
|