RE: Smarty with vBulletin?

From: Date: Thu, 21 Mar 2002 17:00:55 +0000
Subject: RE: Smarty with vBulletin?
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3214@lists.php.net to get a copy of this message
On Thu, 21 Mar 2002, Matt Rogish wrote: > What I am trying to figure out with Smarty is how it 'precompiles' so to > speak. If I have conditional logic in PHP to pull different headers back, > will it create a bunch of php files with each template combination? How > will it know which one to pull back for a specific combination? No, it will not create several .php files if you include different header templates depending on some logic. Each template corresponds exactly to one compiled template. If the source template has: {if $foo} {include file="foo.tpl"} {/if} What happens is that in the .php file you end up having code like this (simplified): <?php if ($this->_tpl_vars['foo']): $this->_smarty_include("foo.tpl", array()); endif; ?> _smarty_include() function is then responsible for locating the foo.tpl template and compiling it if necessary. It doesn't matter where the template comes from, filesyste, DB, etc. -Andrei * Apples have always been a problem ever since Eden. *

« previous php.smarty.general (#3214) next »