Re: [SMARTY] How to use a template in a PHP variable instead saved in a file?
| From: | DeBo | Date: | Sun, 08 Dec 2002 16:55:50 +0000 |
| Subject: | Re: [SMARTY] How to use a template in a PHP variable instead saved in a file? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6697@lists.php.net to get a copy of this message | ||
Hi Scott, hi Rasmus,
you wrote
> In PHP:
> $smarty->assign('file_name', $php_var);
> In the template:
> {include file=$file_name}
Yes, it's right that I can use assign and a $variable instead of the
filename.
But I would'nt like to use a variable instead of the filename, I would like
to use a variable instead of the file itself.
Means, that I would like to have the full template (my HTML code with smarty
macros in a $variable instead in a file.
I.e. in smarty you can write an include statement like this;
{ include file="mytemplatefile.tpl" var1=value1 var2=value2 }
And I need something like this:
{ include variable=$mytemplatesource var1=value1 var2=value2 }
Is this possible to use a variable with the template source instead of a
file with the emplate source?
Debo