challenging Smarty - componentized template

From: Date: Sat, 14 Feb 2004 22:23:11 +0000
Subject: challenging Smarty - componentized template
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2111@lists.php.net to get a copy of this message
Hi all people out there! I've been digisting smarty manual since my last post here and at last have began to write "smarty" style. Want to share my first feelings: code looks pretty nice...and I want to shout out that smartyy rulez! :) 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.. Another question is this : To tell the truth, I chose Smarty at first because of its caching and 'compilation' features and what to benefit from them as much as possible. Currently my structure is this, I have many templates called withing my main template file : index.tpl --> <html code>.....{include file="someteplate.tpl"}.....<some more html code>... {include file="template.tpl"} Well... as I understood from the manual, in order to perform caching (template based - different cache settings for each template), I have to use cache_lifetime before calling each template and each template should be called from main PHP file where I initiate smarty engine: $smarty->cache_lifetime= 300; $smarty->display(someteplate.tpl'); $smarty->cache_lifetime= 3600; $smarty->display(template.tpl'); But thing is that currently I have only one string here,which displayes index.tpl, which itself includes other templates. $smarty->display(index.tpl'); What do you think? Thank you all from now. {* Be Smart. Use Smarty (-; *} Regards, Muhammed Mamedov turkmenweb [dot] com

« previous php.smarty.dev (#2111) next »