Re: including templates dynamically
| From: | Andreas Heintze | Date: | Sun, 16 Dec 2001 14:54:50 +0000 |
| Subject: | Re: including templates dynamically | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2315@lists.php.net to get a copy of this message | ||
I did a little test and this worked:
{foreach from=$templates item=tpl}
{include file=$tpl}
{/foreach}
Where $templates is an array holding the path and template filenames.
I am also just starting to think about a CMS using Smarty, but I was
thinking of doing it as a module to phpshop.
How far has your CMS-project reached?
/Andreas
-----Ursprungligt meddelande-----
Från: Manuel Holtgrewe [mailto:grin@gmx.net]
Skickat: den 16 december 2001 15:03
Till: smarty@lists.ispi.net
Ämne: [smarty] including templates dynamically
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
---
You are currently subscribed to smarty as: andreas.heintze@home.se
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/