Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smartyvalidate and config vars

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
TheSilentOne
Smarty n00b


Joined: 18 Aug 2008
Posts: 2
Location: Kassel / Germany

PostPosted: Mon Aug 18, 2008 7:31 pm    Post subject: Smartyvalidate and config vars Reply with quote

Hello there!

I want to use language files for the complete template system so that a user can change the displayed language easily.

I chose to save the language data in config files as smarty uses them. So I call the language-variables with {#var#} inside the template file.

Of course I also want the error-messages of smartyvalidate to be displayed in the language that the user has set. And here is the problem:

The syntax for setting a criteria inside the template would be
Code:
{validate form="f1" id="username1" message="{#username1#}" append="error"}

Obviously this cannot work because of the closing bracket .


What can I do to use config vars inside the critera definition?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5064
Location: Hamburg / Germany

PostPosted: Mon Aug 18, 2008 8:18 pm    Post subject: Reply with quote

No brackets and no quotes

Code:
{validate form="f1" id="username1" message=#username1# append="error"}
Back to top
View user's profile Send private message
TheSilentOne
Smarty n00b


Joined: 18 Aug 2008
Posts: 2
Location: Kassel / Germany

PostPosted: Mon Aug 18, 2008 8:29 pm    Post subject: Reply with quote

ah, very nice. thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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