For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > March 2004 > Re: [SMARTY] dynamic template









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] dynamic template
Alex

2004-03-19, 1:29 pm

It can do all kind of jazz, for example I use PEAR:DB with Smarty and
end up with scripts such as:

$smarty->assign(array("data" => $db->getAll("SELECT * FROM some_table"),
"time" => stopTiming());
$smarty->display("index.html",$dataHandler->getCacheID());

works like a charm ;)

Alex

Simon Benjamin wrote:
> Hello,
>
> Smarty work dynamic templates? (data from DB, PHP)
>
> ----- code -----
> ... // get data from db
> $db->FetchRow($template); // template data (string!)
>
> $SM->display($template); // ?
> ----- code -----
>
> or works only "static" files?
>
> thx
>

David Förster

2004-03-19, 1:29 pm

Hello,

> Smarty work dynamic templates? (data from DB, PHP)


If you want to retrieve the template itself from a db (or somewhere
else) have a look at that:
http://smarty.php.net/manual/en/tem...m.elsewhere.php


- david
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com