|
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 |
dooshek Smarty n00b
Joined: 19 Jan 2004 Posts: 3
|
Posted: Wed Oct 06, 2004 12:14 pm Post subject: Invalid attribute name? |
|
|
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?
I use latest Smarty 2.6.5. _________________ Dooshek
"Use the force - read the source" |
|
Back to top |
|
dooshek Smarty n00b
Joined: 19 Jan 2004 Posts: 3
|
Posted: Mon Nov 08, 2004 10:57 am Post subject: |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Nov 08, 2004 11:10 am Post subject: |
|
|
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 |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Nov 08, 2004 11:23 am Post subject: Re: Invalid attribute name? |
|
|
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?
I use latest Smarty 2.6.5. |
you can also use SmartyValidate an isRegExp to validate the textareas content |
|
Back to top |
|
dooshek Smarty n00b
Joined: 19 Jan 2004 Posts: 3
|
Posted: Mon Nov 08, 2004 12:16 pm Post subject: |
|
|
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 but thanks for an answer _________________ Dooshek
"Use the force - read the source" |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Nov 08, 2004 3:35 pm Post subject: |
|
|
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 |
|
|
|
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
|