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

Not compiling template first time

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
ryanhargrave
Smarty n00b


Joined: 01 Nov 2009
Posts: 4

PostPosted: Tue Nov 03, 2009 2:04 pm    Post subject: Not compiling template first time Reply with quote

I have an issue if I set compile_check = false and I clear the compile directory, it is not generating the compile files. It keeps trying to find the compiled files that aren't there.

but if I toggle it to compile_check = true load the pages and then back to compile_check = false it works just fine.

Has anyone experienced Smarty not generating the compiled templates when compile_check = false?
Back to top
View user's profile Send private message
ryanhargrave
Smarty n00b


Joined: 01 Nov 2009
Posts: 4

PostPosted: Tue Nov 03, 2009 2:58 pm    Post subject: Reply with quote

seems like the problem is in the renderTemplate method. When the following "if" statement is run:

Code:

            if ($this->mustCompile() && $this->compiled_template === null) {
            $this->compileTemplateSource();
            }


I think it should actually be using an "or" here. Because if you are using the compiler it needs to compile the template if mustCompile() is true or if there is no current compiled template already generated.

this is also a problem when including templates from inside a template as it calls the getCompiledTemplate method which also has the logic possible incorrect.

Not sure if the place to do that is in the renderTemplate method or the mustCompile method as I don't know what else they effect.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Tue Nov 03, 2009 6:01 pm    Post subject: Reply with quote

The correct fix 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