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

general question transforms

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


Joined: 05 Apr 2004
Posts: 28

PostPosted: Fri Jul 23, 2004 5:50 pm    Post subject: general question transforms Reply with quote

If there are more then one error check on a field does the transform need to be called for each check? For example using

{validate field="number" criteria="isInt" transform="trim" .......}

{validate field="number" criteria="isRange" transform="trim" low="1" .......}



Also in the doc "isLenght"

Code:
isLength
    --------
   
    example:
    {validate field="username" criteria="isLength" trim="yes" min="3" max="10" message="..."}
   
    "isLength": checks if field is a given length. "min" and "max"
               attributes required.


I believe the trim="yes" should be transform="trim"
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Fri Jul 23, 2004 6:28 pm    Post subject: Reply with quote

It is not necessary to have the transform="trim" on anything but the first one, but its a negligible overhead to leave them there too. It is convenient to leave them there in case you decide to move validation criteria around or remove them.
Back to top
View user's profile Send private message Visit poster's website
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