Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Smarty 3 Beta 7 Released
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7253
Location: Lincoln Nebraska, USA

PostPosted: Mon Jan 18, 2010 12:08 am    Post subject: Smarty 3 Beta 7 Released Reply with quote

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
View user's profile Send private message Visit poster's website
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Mon Jan 18, 2010 6:16 pm    Post subject: Modifier Handling Reply with quote

- 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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7253
Location: Lincoln Nebraska, USA

PostPosted: Mon Jan 18, 2010 8:32 pm    Post subject: Reply with quote

Didn't get fixed this round. as a workaround, you can make a prefilter to fill in the parens.
Back to top
View user's profile Send private message Visit poster's website
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Mon Jan 18, 2010 8:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
benpbenp
Smarty n00b


Joined: 20 Jan 2010
Posts: 1

PostPosted: Wed Jan 20, 2010 3:43 pm    Post subject: Adding parentheses doesn't help Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Jan 20, 2010 7:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
ZakMc
Smarty Pro


Joined: 04 Oct 2004
Posts: 182

PostPosted: Thu Jan 21, 2010 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 538

PostPosted: Thu Jan 21, 2010 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
ZakMc
Smarty Pro


Joined: 04 Oct 2004
Posts: 182

PostPosted: Thu Jan 21, 2010 3:12 pm    Post subject: Reply with quote

thx @douglassdavis
Back to top
View user's profile Send private message
goper
Smarty Rookie


Joined: 24 Jul 2007
Posts: 5

PostPosted: Tue Jan 26, 2010 1:48 pm    Post subject: Reply with quote

What Smarty 3 release date?
Back to top
View user's profile Send private message
scuzzy
Smarty Regular


Joined: 31 Aug 2003
Posts: 69

PostPosted: Tue Jan 26, 2010 11:04 pm    Post subject: Reply with quote

When its done? Wink
Back to top
View user's profile Send private message
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Mon Feb 15, 2010 2:46 pm    Post subject: Still Stuck on Beta 3 Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Feb 17, 2010 9:38 pm    Post subject: Reply with quote

The restriction that modifiers inside {if} tags needed surrounding parenthesis has been removed with todays SVN update.
Back to top
View user's profile Send private message
st
Smarty n00b


Joined: 20 Feb 2010
Posts: 2

PostPosted: Sat Feb 20, 2010 11:37 pm    Post subject: Reply with quote

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 Wink


Last edited by st on Sat Feb 20, 2010 11:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7253
Location: Lincoln Nebraska, USA

PostPosted: Sat Feb 20, 2010 11:39 pm    Post subject: Reply with quote

are you using the latest SVN? also, why not just:

{if isset($smarty.post.login)}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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