How does compiling work?
| From: | Brian E . Lozier | Date: | Fri, 28 Dec 2001 22:01:38 +0000 |
| Subject: | How does compiling work? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2420@lists.php.net to get a copy of this message | ||
How can a compiled system such as this work? Is it doing all my database calls twice? Is it
rebuilding the
compiled template on each invocation of the script?
If I've got an index.php which contains something like:
$tpl = new Smarty;
$dbInfo = mysql_fetch_row();
$tpl->assign('DBInfo', $dbInfo);
$tpl->display('main.tpl');
It doesn't seem like it has a chance to just use the compiled template BEFORE executing all the
logic in the
main script. So the question is, is it doing all the db calls first, then seeing the compiled
'main.tpl',
deciding it doesn't need recompiling, then it's re-doing all the db calls in the compiled
version, ignoring
everything that happened previously?
Brian