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

Invalid attribute name?

 
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
dooshek
Smarty n00b


Joined: 19 Jan 2004
Posts: 3

PostPosted: Wed Oct 06, 2004 12:14 pm    Post subject: Invalid attribute name? Reply with quote

I have plugin called textarea:

Code:

{textarea name="short" width=310 height=40 check=0 checkfunction="Regexp('/.{1,25}')" error="Enter short description (max. 55 chars)" x=0 y=12}


and when called this I get error from Smarty -

Quote:

Fatal error: Smarty error: [in templates/FormDefinitions/products/Edit.tpl line 36]: syntax error: invalid attribute name: '/.{1,25' (Smarty_Compiler.class.php, line 1508) in c:\www\multisortadmin\smarty\Smarty.class.php on line 1084


Hmm, maybe this is not a bug but I thought that I can use { in attributes to function plugin. I tried also {ldelim} and {rdelim} but it also does not work. Is it a bug or feature? Wink

I use latest Smarty 2.6.5.
_________________
Dooshek

"Use the force - read the source"
Back to top
View user's profile Send private message
dooshek
Smarty n00b


Joined: 19 Jan 2004
Posts: 3

PostPosted: Mon Nov 08, 2004 10:57 am    Post subject: Reply with quote

Hmm, can anyone just give me a short answer? Is this a bug or feature???
_________________
Dooshek

"Use the force - read the source"
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Mon Nov 08, 2004 11:10 am    Post subject: Reply with quote

dooshek wrote:
Hmm, can anyone just give me a short answer?


sure.

Quote:
Is this a bug or feature???


bug. you cannot use '{' and '}' inside doublequoted text.
i doubt somebody will fix this, though.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Mon Nov 08, 2004 11:23 am    Post subject: Re: Invalid attribute name? Reply with quote

dooshek wrote:
I have plugin called textarea:

Code:

{textarea name="short" width=310 height=40 check=0 checkfunction="Regexp('/.{1,25}')" error="Enter short description (max. 55 chars)" x=0 y=12}


and when called this I get error from Smarty -

Quote:

Fatal error: Smarty error: [in templates/FormDefinitions/products/Edit.tpl line 36]: syntax error: invalid attribute name: '/.{1,25' (Smarty_Compiler.class.php, line 1508) in c:\www\multisortadmin\smarty\Smarty.class.php on line 1084


Hmm, maybe this is not a bug but I thought that I can use { in attributes to function plugin. I tried also {ldelim} and {rdelim} but it also does not work. Is it a bug or feature? Wink

I use latest Smarty 2.6.5.


you can also use SmartyValidate an isRegExp to validate the textareas content
Back to top
View user's profile Send private message
dooshek
Smarty n00b


Joined: 19 Jan 2004
Posts: 3

PostPosted: Mon Nov 08, 2004 12:16 pm    Post subject: Reply with quote

messju wrote:
dooshek wrote:
Hmm, can anyone just give me a short answer?


sure.

Quote:
Is this a bug or feature???


bug. you cannot use '{' and '}' inside doublequoted text.
i doubt somebody will fix this, though.


that's bad Sad but thanks for an answer
_________________
Dooshek

"Use the force - read the source"
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Nov 08, 2004 3:35 pm    Post subject: Reply with quote

Just to be pendantic, it's actually only the closing "}" that messes up the compiler. As Messju suggests, even if it is fixable, it isn't worth it and it probably won't be done. Monte recently added $smarty.ldelim and $smarty.rdelim which should allow you to work-around that little annoyance although a bit awkwardly.
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