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

html_select_date, extra parameters

 
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
Jerc
Smarty Rookie


Joined: 26 Jan 2010
Posts: 30
Location: Slovenia / Ljubljana

PostPosted: Wed May 23, 2012 7:28 am    Post subject: html_select_date, extra parameters Reply with quote

I would like to add jQuery data-inline="true" parameter. But extra parameter could not have '-' as "key". It works fine if parameter is datainline, data_inline,...

This is my code (it throws exception):
Code:
{html_select_date prefix='ccExp' display_days=false display_years=false month_value_format='%m' data-inline='true'}


Tested on Smarty: 3.0.8 and 3.1.8.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Wed May 23, 2012 7:59 am    Post subject: Reply with quote

This is a parser issue. I believe Uwe and I have discussed this a couple of months ago. There was some sort of problem with »-« in a property name. Maybe Uwe can look into this again?
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


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

PostPosted: Wed May 23, 2012 8:04 pm    Post subject: Reply with quote

'-' is not a valid character in variable, attribute and function names as in any programming language as it could be source of ambiguous syntax.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Wed May 23, 2012 8:25 pm    Post subject: Reply with quote

Isn't »foo-bar=« pretty specific enough?
In Smarty-terms »bar=« is not regarded as an assignment (because »bar« is not a variable). I don't see where »[a-zA-Z0-9_-]+« would pose any problems as parameter name.
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


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

PostPosted: Thu May 24, 2012 4:02 pm    Post subject: Reply with quote

Plugin parameter name may now contain also "-" and ":".

The fix is now in the SVN trunk and will later be included in 3.1.9
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Thu May 24, 2012 4:09 pm    Post subject: Reply with quote

For clarification, »data-name=""« for HTML5 compatibility and »foo:bar="baz"« for XML compatibility (might be required for OpenGraph stuff)
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Jerc
Smarty Rookie


Joined: 26 Jan 2010
Posts: 30
Location: Slovenia / Ljubljana

PostPosted: Fri May 25, 2012 6:06 am    Post subject: Reply with quote

Many thanks for very quick fix.
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