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

[PATCH] _mod_regexp: support empty modifier arguments

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
jablko
Smarty Rookie


Joined: 07 Apr 2006
Posts: 6

PostPosted: Wed Jun 21, 2006 11:52 pm    Post subject: [PATCH] _mod_regexp: support empty modifier arguments Reply with quote

http://cgi.sfu.ca/~jdbates/tmp/smarty/200606210/patch

I wrote a modifier plugin which takes two optional arguments. Sometimes I want to specify the second argument without specifying the first:

{"foo"|elementId:"bar"}

But without specifying the first argument, "bar" is passed as the first argument

{"foo"|elementId::"bar"} - currently complains: unrecognized tag

This patch fixes _mod_regexp so "bar" is passed as the second argument

Many thanks - Jack
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jun 22, 2006 12:21 am    Post subject: Reply with quote

Hi.

Thanks for the patch but I think you will find that {"foo"|elementId:null:"bar"} works just as well, takes only four more keystrokes, is easier to visually spot (and debug!) and saves the :: token for possible future use.

Personally, I don't think that the current functionality is broken. I'm -1 for this patch.

Best regards.
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 -> Bugs 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