Re: [SMARTY] parse string
| From: | Manfred Stienstra | Date: | Tue, 11 Feb 2003 08:29:37 +0000 |
| Subject: | Re: [SMARTY] parse string | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7632@lists.php.net to get a copy of this message | ||
On Tuesday 11 February 2003 09:16, Uroš Gruber wrote:
> Hi!
>
> i\'ve made some kind of CMS and all my pages is saved in DB. I
> save only content not headers and footers. For this i have some
> index.tpl with {$content} inside and before i output i assign
> content i get from DB.
>
> Now i want to use some smarty tags in this content. For example
> {include}, because i have a lot of pages where i show some menu
> and if i change this i have to change on all of pages.
>
> I make this menu and save it in menu.tpl.
>
> Is it possible to parse string from DB and include this menu.tpl
> in it and then assign to {$content}.
You don't have to parse it yourself, just write (or copy) a database handler,
with the handler you can include the templates from the database in your
templates.
see:
http://smarty.php.net/manual/en/templates.from.elsewhere.php
Manfred