Re: [SMARTY-DEV] challenging Smarty - componentized template
| From: | Muhammed Mamedov | Date: | Mon, 16 Feb 2004 22:44:35 +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-2115@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Marcus Bointon" <marcus@synchromedia.co.uk>
To: "Smarty dev" <smarty-dev@lists.php.net>
Sent: Monday, February 16, 2004 1:18 PM
Subject: Re: [SMARTY-DEV] challenging Smarty - componentized template
> 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.
m@m : You say that it is weird to include php files into templates. Well, I
found this
way to handle componentized templates from Smarty's Manual:( Chapter 18.
Tips & Tricks,
Componentized Templates). They even provide an example there :
index.tpl
---------
{* Smarty *}
{include_php file="load_ticker.php"} {* THIS IS THE WAY I DO MY
PHP+TEMPLATE STUFF NOW *}
Stock Name: {$ticker_name} Stock Price: {$ticker_price}
What do you think?..
>
> 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...
>
What is extension? Can you describe in brief? I will also check that
myself..
> Marcus
> --
> Marcus Bointon
> Synchromedia Limited: Putting you in the picture
> marcus@synchromedia.co.uk | http://www.synchromedia.co.uk
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>