Re: runtime template parsing
| From: | Monte Ohrt | Date: | Mon, 07 May 2001 19:07:51 +0000 |
| Subject: | Re: runtime template parsing | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-691@lists.php.net to get a copy of this message | ||
btw, Smarty 1.4.0 supports database driven template files (or whatever
you program your template resource functions to do.) This would be a
much cleaner solution for what you are trying to accomplish here.
Ivo Jansch wrote:
>
> 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: monte@ispi.net<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
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/