|
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 |
NoWhereMan Smarty Rookie
Joined: 14 Feb 2006 Posts: 15
|
Posted: Sun Jan 28, 2007 10:54 am Post subject: [SmartyValidate] Problem with append ? |
|
|
Code: | {validate id="subject" message=$panelstrings.error.subject append="error"}
{validate id="content" message=$panelstrings.error.content append="error"}
{if $error}
<ul class="errorlist">
{foreach from=$error key=field item=msg}
<li>{$field} : {$msg}</li>
{/foreach}
</ul>
{/if} |
this prints "0 : the error"
and no "Myfield : the error"
Am I missing something ?
thank you
EDIT:
function.validate.php line 117 I've changed it into this:
Code: | $smarty->append($params['append'], array($_sess['validators'][$_validator_key]['field']=>$_sess['validators'][$_validator_key]['message']), true); |
hope it's correct |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
brice Smarty Rookie
Joined: 14 Apr 2006 Posts: 11
|
Posted: Thu Feb 15, 2007 12:17 am Post subject: |
|
|
I was able to accomplish similar behavior using the "key" attribute of {validate} -- e.g.
Code: |
{validate key="username" field="username" message="invalid username" append="svErrorArray"}
|
No source code hack needed. It would be nice to see BETTER DOCUMENTATION of this in the README.. as I don't think enumerated keys are as useful as the fieldname/ID.
UPDATE: apparently the key fix was black magic. It is not working anymore...
~ Brice |
|
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
|