Re: [phplib] parse template into $variable From: Layne Weathers (layne <email protected>)
Date: 05/09/01

> perhaps I'm not seeing the wood for the trees, but is it
> possible in some
> way to parse a template file and then put the result into a
> PHP variable?
>
> I'm trying to use the PHPLIB templates to send e-mails.

Parse and finish your template and then get the variable.

$t = new Template;
$t->set_file('file', 'blah.tpl');
< do stuff here >
$t->parse('file', 'out');
$t->finish('out');
$email_body = $t->get_var('out');

Layne Weathers
Ifworld, Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>