Re: [SMARTY] How to use a template in a PHP variable instead saved in a file?
| From: | Scott Barron | Date: | Sun, 08 Dec 2002 15:55:41 +0000 |
| Subject: | Re: [SMARTY] How to use a template in a PHP variable instead saved in a file? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6691@lists.php.net to get a copy of this message | ||
On Sun, Dec 08, 2002 at 04:46:03PM +0100, DeBo wrote:
> To include a template in a file i have to write
> { include file="mytemp1.tpl" }
>
> How can I use a template which is stored in a PHP variable?
>
> Debo
Hi,
In PHP:
$smarty->assign('file_name', $php_var);
In the template:
{include file=$file_name}
-Scott
--
eventus stultorum magister