View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jan 18, 2010 12:08 am Post subject: Smarty 3 Beta 7 Released |
|
|
The seventh beta of Smarty 3 has been released! Please join the developer mailing list and see the Smarty 3 section of the forums and give us feedback!
http://www.smarty.net/ |
|
Back to top |
|
httpete Smarty Rookie
Joined: 05 Dec 2009 Posts: 27
|
Posted: Mon Jan 18, 2010 6:16 pm Post subject: Modifier Handling |
|
|
- changed back modifer handling in parser. Some restrictions still apply:
if modifiers are used in side {if...} expression or in mathematical expressions
parentheses must be used.
Uwe you had replied that this would be fixed - in what beta release will it be fixed DYT? Thank you very much. I cannot put parens around all of the modifiers I have, must be thousands. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jan 18, 2010 8:32 pm Post subject: |
|
|
Didn't get fixed this round. as a workaround, you can make a prefilter to fill in the parens. |
|
Back to top |
|
httpete Smarty Rookie
Joined: 05 Dec 2009 Posts: 27
|
Posted: Mon Jan 18, 2010 8:36 pm Post subject: |
|
|
Thank you mohrt, it is NP I can wait until the final release that fixes this, my site is humming just fine on the first beta before this section got changed.
Pete |
|
Back to top |
|
benpbenp Smarty n00b
Joined: 20 Jan 2010 Posts: 1
|
Posted: Wed Jan 20, 2010 3:43 pm Post subject: Adding parentheses doesn't help |
|
|
This used to work: EDIT: (back in smarty 3 beta 2, I believe)
{if !isset($item->posted) or $item->posted|date_format:'%Y'==0}
It doesn't anymore, and adding parentheses doesn't help:
{if (!isset($item->posted) or $item->posted|date_format:'%Y'==0)}
The error is
Unexpected "|", expected one of: ")"
Is there something wrong with my code? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jan 20, 2010 7:39 pm Post subject: |
|
|
Your example
{if !isset($item->posted) or $item->posted|date_format:'%Y'==0}
does work in beta7.
But there are still cases where currently parenthesis are needed. These have to be just around the variable and its attached modtifier like
{if !isset($item->posted) or ($item->posted|date_format:'%Y')==0}
I hope I get the general parser problem solved during the next few days. |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
Posted: Thu Jan 21, 2010 9:49 am Post subject: |
|
|
I want to call a function with an array as param.
Code: | {somefunction( array('mainpage'=>'caps') )} |
This doesn´t work, but this
Code: | {somefunction( array('caps') )} |
The error of the frist one:
" - Unexpected "=>", expected one of: ")"
Is this still a bug or by design?
Thx Mike |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Thu Jan 21, 2010 1:53 pm Post subject: |
|
|
ZakMc wrote: | I want to call a function with an array as param.
Code: | {somefunction( array('mainpage'=>'caps') )} |
This doesn´t work, but this
Code: | {somefunction( array('caps') )} |
The error of the frist one:
" - Unexpected "=>", expected one of: ")"
Is this still a bug or by design?
Thx Mike |
http://www.smarty.net/forums/viewtopic.php?t=16605 |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
Posted: Thu Jan 21, 2010 3:12 pm Post subject: |
|
|
thx @douglassdavis |
|
Back to top |
|
goper Smarty Rookie
Joined: 24 Jul 2007 Posts: 5
|
Posted: Tue Jan 26, 2010 1:48 pm Post subject: |
|
|
What Smarty 3 release date? |
|
Back to top |
|
scuzzy Smarty Regular
Joined: 31 Aug 2003 Posts: 84
|
Posted: Tue Jan 26, 2010 11:04 pm Post subject: |
|
|
When its done? |
|
Back to top |
|
httpete Smarty Rookie
Joined: 05 Dec 2009 Posts: 27
|
Posted: Mon Feb 15, 2010 2:46 pm Post subject: Still Stuck on Beta 3 |
|
|
Gents,
For now I have no choice but to stick to Beta 3, as it is the only Beta release that is compatible with Smarty 2 syntax. I hope this is suitable for production, because we are going with it. Any ideas on timelines for a Beta that allows modifiers in IF statements without parens? Can I pitch in on some testing?
httpete |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Feb 17, 2010 9:38 pm Post subject: |
|
|
The restriction that modifiers inside {if} tags needed surrounding parenthesis has been removed with todays SVN update. |
|
Back to top |
|
st Smarty n00b
Joined: 20 Feb 2010 Posts: 2
|
Posted: Sat Feb 20, 2010 11:37 pm Post subject: |
|
|
I've got massive problems with things like {if array_key_exists('login', $smarty.post)} or {$smarty.post.username|htmlspecialchars} with this beta release. Is this a known issue or should I further investigate on it? There are no problems with b4, though.
PS: Do you participate the Google Summer of Code? I'm a student and would love to be a part of it
Last edited by st on Sat Feb 20, 2010 11:39 pm; edited 1 time in total |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Feb 20, 2010 11:39 pm Post subject: |
|
|
are you using the latest SVN? also, why not just:
{if isset($smarty.post.login)} |
|
Back to top |
|
|