Re: [SMARTY-DEV] challenging Smarty - componentized template
| From: | Marcus Bointon | Date: | Mon, 16 Feb 2004 11:18:26 +0000 |
| Subject: | Re: [SMARTY-DEV] challenging Smarty - componentized template | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2114@lists.php.net to get a copy of this message | ||
on 14/2/04 22:23, Muhammed Mamedov at muhammed@ytm.com.tr wrote:
> But still having some questions with the general Smarty work principle, like
> for example "Is there a performance difference using {include file='dddd.tpl'}
> and {include_php file=''somephp.file}?" I am currently trying
>
smartize my
> 100% ready and running PHP site and wonder if I have to transform my .php
> includes into .tpl files where possible, or including php directly in
> templates is also ok..
I don't know what the performance difference might be, because you probably
shouldn't be doing it anyway. Most of the point of Smarty is to keep code
out of your templates, or at least keep it to handling presentation logic
(which is what Smarty's logic is for), so you should not really ever need to
include a PHP file in your template.
Including template components is an excellent way to work, I use it for
headers and footers etc. If you're regularly wanting to include PHP in your
templates, either you've got your logic mixed up, or you should perhaps look
at writing a Smarty extension...
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk