Print Smarty-code saved in database?
| From: | Johannes | Date: | Mon, 02 Feb 2004 21:39:32 +0000 |
| Subject: | Print Smarty-code saved in database? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10915@lists.php.net to get a copy of this message | ||
Hi list and others
Im trying to put SMARTY-code like {$smarty.now|date_format} in a text field
returned from mysql database and then display it. This do not work. So I'm
happy for clues to solve this and mayby explantions way I cant display my
Smarty code correct. Very many thanks!
Like this:
$tpl = gettpl($docid); //php function return a template
$doc = getdoc($docid); //php function return a txt-field, Smarty code IN it.
$smarty->assign("data", $doc); // assign the txt-field
$smarty->display($tpl); // display
See the result on here -> http://formformat.griffel.se/get_page.php?docid=17
-----------------------------------------------------
Johannes Fosseus
Poeter.se