including templates dynamically
| From: | Manuel Holtgrewe | Date: | Sun, 16 Dec 2001 14:03:29 +0000 |
| Subject: | including templates dynamically | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2314@lists.php.net to get a copy of this message | ||
Hi!
I'm writing an CMS system using Smarty. For the system I have to include templates dynamically. Well, let's say, I have given Smarty the names of the templates I want to include in an array named "templates".
Now I tried the following:
{section name=tpl loop=$templates}
{include file="plugins/$templates[tpl]/plugin.tpl"}
{/section}
It does not work. Smarty tries to find "plugins//plugin.tpl" (or at least the error message tells me).
Is there a work-around or doesn't Smarty support such things?
cya
Manuel
--
what privilege do we have under the sun,
that gives us the right to the throne ?
In Flames - Coerced Coexistance