Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Smarty 3 beta 6 released

 
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: 7299
Location: Lincoln Nebraska, USA

PostPosted: Mon Jan 11, 2010 10:37 pm    Post subject: Smarty 3 beta 6 released Reply with quote

The sixth beta of Smarty 3 has been released! A lot has been going on since the last beta, be sure to get updated. 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: Tue Jan 12, 2010 5:09 pm    Post subject: Difference between smarty 3 beta 5 and beta 6 Reply with quote

In beta 5 this worked:

{if $smarty.request.showonlynew|strtolower eq 'on'}

In beta 6 it needed:

{if strtolower($smarty.request.showonlynew) eq 'on'}


This is a major factor for us, as it changes behavior from smarty 2 substantially. Can someone let me know what the final decision on the behavior is? I have so many cases using modifiers in if statements, this might block my adoption of Smarty 3. I feel this is a major difference from 2 behavior.
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue Jan 12, 2010 5:22 pm    Post subject: Reply with quote

it will get fixed
Back to top
View user's profile Send private message Visit poster's website
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Tue Jan 12, 2010 5:32 pm    Post subject: Reply with quote

Thank you very, very much. I am stabilizing against beta 5 behavior right now.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Tue Jan 12, 2010 7:20 pm    Post subject: Reply with quote

Sorry

I did screw up the parser just before the release of beta 6.

The SVN is now updated with a version which does work with same
restriction as the SVN versions before.

The restrictions is:

If modifiers are used in {if...} or mathematical expressions you must
use parentheses like

{if ($products|@count) == 2}
{if ($newsitem.news_date|date_format:"%Y") == 2008}

{$x = ($y|strlen) + ($z|strlen)}

I will try to remove this restriction ASAP.

Uwe
Back to top
View user's profile Send private message
dustinb
Smarty Rookie


Joined: 20 Feb 2009
Posts: 12

PostPosted: Thu Jan 14, 2010 6:47 pm    Post subject: $smarty.cookies Reply with quote

Seems in beta 6 $smarty.cookies broke. I went back to beta 4 where it was working because that's the last version I was last using.

Not really any detail to give $smarty.cookies.something doesn't show anything in 6 but does in 4
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Jan 14, 2010 7:13 pm    Post subject: Reply with quote

The fix for $smarty.cookies is in the SVN now.
Back to top
View user's profile Send private message
legende
Smarty n00b


Joined: 17 Jan 2010
Posts: 3

PostPosted: Sun Jan 17, 2010 1:30 pm    Post subject: Reply with quote

PHP
define 'MYCONSTANT', '100'

Code in smarty template
{$const="{$smarty.const.MYCONSTANT}"}
{$const}

produces in beta6: {@MYCONSTANT}
produces in beta5: 100
Back to top
View user's profile Send private message
djmassive
Smarty n00b


Joined: 17 Jan 2010
Posts: 1

PostPosted: Sun Jan 17, 2010 3:41 pm    Post subject: Reply with quote

In Smarty3 B6:
{include file="`$smarty.const.MYCONST`modules/file.tpl"}

gives error:

Code:
Fatal error: Uncaught exception 'Exception' with message 'Unable to load template file '`@_URL_MAIN`/templates/menu.smarty'' in C:\wamp\www\Alsmart\admin\classes\smarty\sysplugins\smarty_internal_template.php:169 Stack trace: #0 C:\wamp\www\Alsmart\admin\classes\smarty\sysplugins\smarty_internal_template.php(513): Smarty_Internal_Template->isExisting(true) #1 C:\wamp\www\Alsmart\admin\cache\a5ee3086d3e25b6f9eb408edc9c5a861aadb3fe4.file.index.smarty.php(60): Smarty_Internal_Template->getRenderedTemplate() #2 C:\wamp\www\Alsmart\admin\classes\smarty\sysplugins\smarty_internal_template.php(405): include('C:\wamp\www\Als...') #3 C:\wamp\www\Alsmart\admin\classes\smarty\sysplugins\smarty_internal_template.php(517): Smarty_Internal_Template->renderTemplate() #4 C:\wamp\www\Alsmart\admin\classes\smarty\Smarty.class.php(308): Smarty_Internal_Template->getRenderedTemplate() #5 C:\wamp\www\Alsmart\admin\classes\smarty\Smarty.class.php(325): Smarty->fetch('C:/wamp/www/als...', NULL, NULL, NULL) #6 C:\wamp\www\Alsmart\admin\footer.ph in C:\wamp\www\Alsmart\admin\classes\smarty\sysplugins\smarty_internal_template.php on line 169


How to use predefined const with smarty 3 ?? Maybe this should be repaired ??
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Jan 17, 2010 3:55 pm    Post subject: Reply with quote

The fix for $smarty.const.... inside double quote strings is in the SVN now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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