Re: [PHP Template] Includes in templates

[email protected] (Andrei Zmievski) Thu, 30 Mar 2000 09:08:09 -0600
Newsgroups php.template
Message-ID <[email protected]>
On Thu, 30 Mar 2000, Peter Andreasen wrote:
> No, because it is might not be dynamic data. Let's say I throughout my
> site use the following whenever I need a nicelooking headline:
> 
>    <table width="100%" border=1 bgcolor="black" cellpadding=4>
>    <tr><td>
>      <font color=white size=2>
> 
>        This is a headline
> 
>      </font>
>    </td></tr>
>    </table>
> 
> While I could just type in the whole thing every time, it would be so
> much easier for me to just write
> 
>    { include niceheadline.tpl ('headline' => 'This is a headline') }
> 
> instead. Optimally I could even write
> 
>    { include niceheadline.tpl ('headline' => '{$dynamic_headline}') }
> 
> _if_ my headlines came from some logic (in php).
> 
> Does it makes sense?

Yes, I understand what you are saying. I suppose there could be cases
where a designer would want to have some variables used in included
templates that don't come from the script. Something like this could be
added to the template engine spec. However, we need to think long and
hard about exactly how far we want to take the template engine. We
definitely don't want it to turn into another scripting language, do we?

-Andrei
* Why is it always Segmentation's fault? *