include a file assigned by a php variable?!
| From: | Achim Gosse | Date: | Thu, 23 May 2002 09:09:57 +0000 |
| Subject: | include a file assigned by a php variable?! | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4376@lists.php.net to get a copy of this message | ||
hi,
i want to use the include function to include different sub templates
regarding some variables.
example:
--- basic template ---
{include file=$header}
some text
{include file=$footer}
--- basic template ---
--- php script ---
...
$tmpl->Assign("footer", "footer_1.tmpl");
$tmpl->Assign("header", "header_1.tmpl");
$tmpl->Display("basic.tmpl");
--- php script ---
unfortunately this does not work.
this error occurs:
...unable to read template resource: "Array" in ...
what's wrong here?
how can i use "dynamic" sub templates?
regdards and thanks in advance.
/achim