|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Tue Nov 20, 2012 7:20 pm Post subject: Call to undefine function & incorrect inline includes |
|
|
It seems that in some cases templates are included as inline with merge_compiled_includes=false and without inline flag.
I found this after I got this error "Call to undefined function content_50abd609f35257_33609651()". I checked the compiled code and found setupInlineSubTemplate('my-template.html') function which I guess is responsible for inline includes.
After I change my code from {include 'my-template.html'} to {$var = 'my-template.html'}{include $var} the problem with undefined function disappeared.
The include that caused error was located inside a function and also inside a parent (extended) template. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Nov 21, 2012 11:36 am Post subject: |
|
|
Template inheritance does compile in certain conditions {include} with {block} {/block} as inline code even if merge_compiled_includes=false.
The reasion is that the {include} could also contain further {block} tags.
As inhertance in 3.1 is a compile time process the compiled code of the {include} could not be shared with other child/parent template constallations.
By making the {include} template name variable you tricked this wanted behaviour out, because inline subtemplate can't work on variable template names.
However you should not have had the undefined function error.
Anyway in the upcomming 3.2 version inheritance will no longer be a compile time process. This does elimite the need for inline {includes} |
|
Back to top |
|
|
|
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
|