Re: [SMARTY] Print Smarty-code saved in database?

From: Date: Mon, 02 Feb 2004 23:23:39 +0000
Subject: Re: [SMARTY] Print Smarty-code saved in database?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10916@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. did you tried: $doc = $smarty -> fetch(getdoc($docid)); > > $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 > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#10916) next »