challenging Smarty - componentized template
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
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
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php