Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Understanding compile_id

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Nov 25, 2015 1:18 pm    Post subject: Understanding compile_id Reply with quote

I'm struggling to get the full picture of Smarty::$compile_id implications.
I understand, that specifying a distinct compile_id for same template will produce a separate compiled version of it. But in which cases the versions would be actually different? (Or, in other words, the use of compile_id actually do make sense.)
Perhaps, someone can do a sanity check on the following list, please?
The documentation hinting on these two possible cases:

1. Compile-time transformations. Quite obvious, when you transform the same template in multiple ways, you end up with an actual different templates.
2. Shared compiled template cache for independent sets of similarly named template sources. That's… questionable practice, but I think I understand the implication.

Is there any other cases?
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Nov 25, 2015 7:16 pm    Post subject: Reply with quote

1. The compile_id should be used when running the template through different pre- or post-filters during compiling.

2.In Smarty 2 templates with same name from different template_dir did compile in same compiled template, so it did make sense there. This is not the case in Smarty 3.

3.Currently template inheritance is a compile time process. An {extends} tag with a variable template name did require different compile_id. This restriction will be removed with 3.1.28 where inheritance will become a runtime process.


Last edited by U.Tews on Thu Nov 26, 2015 12:13 am; edited 1 time in total
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Nov 25, 2015 10:57 pm    Post subject: Reply with quote

U.Tews wrote:
2.In Smarty 2 templates with same name from different template_dir did compile in same compiled template, so it did make sense there. This is not the case in Smarty 3.

Shouldn't the documentation be amended then?

Quote:
This restriction will be removed with 3.1.28 where inheritance will become a compile time process.

Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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