RE: runtime template parsing
| From: | Brian Andrews | Date: | Mon, 07 May 2001 08:55:01 +0000 |
| Subject: | RE: runtime template parsing | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-687@lists.php.net to get a copy of this message | ||
can't you do:
<html>
<body>
{include file=$title}
or try using the new 1.4 resource syntax:
{include file="db:/stuff/title.tpl"}
kinda thing?
http://www.phpinsider.com/php/code/Smarty/beta/Smarty-1.4.0b2/docs/x488.htm#
AEN503
tpl's are compiled at runtime with 1.4
-
brian
> -----Original Message-----
> From: ivo@informate.co.nz [mailto:ivo@informate.co.nz]On Behalf Of Ivo
> Jansch
> Sent: Monday, 7 May 2001 19:05
> To: smarty@lists.ispi.net
> Subject: [smarty] runtime template parsing
>
>
> Hi,
>
> In my templated site, I have some content, which contains embedded
> template syntax.
>
> It's easier to explain what I mean by giving an example:
>
> main.tpl:
>
> <html>
> <body>
> {$title}
> <hr>
> {$body}
>
> ---<BR>
> You are currently subscribed to smarty as: brian@informate.co.nz<BR>
> To unsubscribe send a blank email to
> $subst('Email.Unsub')<BR>
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
> </BODY>
> </html>
>
> $title and $body are assigned in main.php, where they are read from a
> database first.
>
> Now suppose $body contains stuff like {include} or a repetition of
> {$title} or some other template syntax.
>
> Is there an easy way to call the template parser at runtime? Smarty
> would have to compile to a temporary file, I guess, and include that.
>
> Greetings,
> Ivo
>
> --
> Ivo Jansch <ivo@ibuildings.nl>
> ibuildings.nl BV - information technology
> http://www.ibuildings.nl
>