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

Major change of string resource in SVN

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
U.Tews
Administrator


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

PostPosted: Fri Oct 01, 2010 1:47 pm    Post subject: Major change of string resource in SVN Reply with quote

Todays update of the SVN does include a major change in the behaviour of string resources.

Up to now string resources have been evaluted which mean they got compiled on each call and the compiled result was not stored for later use.

From now on string resources create a compiled file which is reused when the string did not change. This will improve performance quiet a bit.
The draw back is that Smarty can't detect automatically when a string has changed and will no longer be used. If you have frequent changing string templates it could fill up the compiled template folder.

There is a new eval resource which still provides the old behaviour.

Code:
// eval a string template and do not store compiled code
$smarty->display('eval:'.$string);

// display string template and store compiled code
$smarty->display('string:'.$string);


The {eval} tag within templates is still evaluated. You can modify your templates to use
Code:
{include file="string:$foo"}

to store compiled code as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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