Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Call to undefine function & incorrect inline includes

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Tue Nov 20, 2012 7:20 pm    Post subject: Call to undefine function & incorrect inline includes Reply with quote

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


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

PostPosted: Wed Nov 21, 2012 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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