|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Cronet Smarty Rookie
Joined: 21 May 2003 Posts: 15
|
Posted: Thu May 22, 2003 11:59 am Post subject: smarty tags in db? |
|
|
Hi There,
i want to store the complete <body> tag of a site in a DB.
my tpl looks like this:
Code: | {include file="header.tpl"}
{$body}
{include file="footer.tpl"} |
but smarty doesn't interprate tags coming from the db.
e.g. <img src="{$rel_path}/site/pictures/all.jpg">
how to realize this?
Greets from Germany,
Cronet |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
Cronet Smarty Rookie
Joined: 21 May 2003 Posts: 15
|
Posted: Thu May 22, 2003 4:43 pm Post subject: |
|
|
Is there a another way??
Much effort for only one variable...
It's really only the {$rel_path} for images that i need to grab...
Hm.. but to tell the truth.. i think I didn't understand that way in my case...
Greets
Cronet |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu May 22, 2003 4:58 pm Post subject: |
|
|
hmm,
you can use eval http://smarty.php.net/manual/en/language.function.eval.php
but that is slow.
or you can search and replace {$rel_path} in php with str_replace or preg_replace before you assign $body to smarty. but that won't scale if your demands start to grow, and you want to do more smarty-stuff in your $body. |
|
Back to top |
|
Cronet Smarty Rookie
Joined: 21 May 2003 Posts: 15
|
Posted: Thu May 22, 2003 5:10 pm Post subject: |
|
|
Hi messju,
thanks for replaying..
I think the search and replace way is for me the best at the momen...
Thats my first experiences with smarty.. and I think time brings experience...
Thanks for your help
Greets Cronet |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|