Re: [SMARTY] Question about smarty, and if it can replace PHPLIB
| From: | Tom Sommer | Date: | Wed, 19 Feb 2003 14:15:55 +0000 |
| Subject: | Re: [SMARTY] Question about smarty, and if it can replace PHPLIB | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7871@lists.php.net to get a copy of this message | ||
"Messju Mohr" <messju@lammfellpuschen.de> wrote in
news:20030219140741.GH1626@pharao.lammfellpuschen.de...
> definately :)
cool
> in short:
> $smarty->assign('CONTENT', $smarty->fetch('content.tpl'));
> $smarty->display('index.tpl');
I see, but! my question is this
Before I fetch the file, I will have to parse it, add vars etc. to it...
on ny _news.php_ now, I have
require_once('init.php'); // Loads the template and makes everything ready
to parse index.tpl
$template->set_file('news','news.tpl');
$template->set_var('NEWSITEM','this thing');
$template->set_var('CONTENT',$template->parse('news','news'));
// Lets display the entire site, based on index.tpl
$template->pparse('output','index'); // index is the alias for index.tpl
if you get my point...
--
Tom Sommer
www.tsn.dk - www.dreamcoder.dk