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

eval as Smarty-Code?

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
TommyD
Smarty Rookie


Joined: 20 Feb 2004
Posts: 18

PostPosted: Mon Feb 23, 2004 1:35 pm    Post subject: eval as Smarty-Code? Reply with quote

Hi!

Does the following thing make sense? What I like to achieve is to be able to do in-place error output for formular elements with localized content.

Code:
de.conf
=====

[login]
error_login = "Falsche Eingabe"

uk.conf
=====

[login]
error_login = "Wrong value"


index.tpl
=====

{config_load file="$language.conf" section="login"}

<form ...>
<input type="text" name="foo">
{eval_smarty value=$error}
...
</form>


index.php
=====

$sm = new Smarty();
$sm->assign("error","error_login");
$sm->display("index.tpl");

_________________
Administrator / Developer on http://www.musicmademe.com
- http://thomaskeller.biz
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Feb 23, 2004 2:02 pm    Post subject: Reply with quote

the localized message should be in {$smarty.config.$error} . no need for an eval here.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TommyD
Smarty Rookie


Joined: 20 Feb 2004
Posts: 18

PostPosted: Mon Feb 23, 2004 2:06 pm    Post subject: Reply with quote

Well, I should read the english manual instead of the localized german one =)

Thanks a bunch.
Tommy.
_________________
Administrator / Developer on http://www.musicmademe.com
- http://thomaskeller.biz
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 -> Feature Requests 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