Re: how to use one file for static sites...
| From: | Monte Ohrt | Date: | Thu, 12 Apr 2001 14:46:55 +0000 |
| Subject: | Re: how to use one file for static sites... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-529@lists.php.net to get a copy of this message | ||
You can code it however you want. You can have a php script for each
template, But that quickly becomes unmanagable for large applications
imho.
You can easily have one point-of-entry on the site, and depending on the
parameters passed to that script, it calls different templates.
simplified example:
http://www.yoursite.com/display.php?target=home
// display.php
$smarty = new Smarty;
switch($target) {
case "news":
$smarty->display("news.tpl");
break;
case "faq":
$smarty->display("faq.tpl");
break;
case "home":
default:
$smarty->display("index.tpl");
break;
}
Oguz Altun wrote:
>
> ----- Original Message -----
> From: "Hojtsy Gabor" <goba@mail.digitel2002.hu>
> To: "Oguz Altun" <oguz@planet.net.tr>; <smarty@lists.ispi.net>
> Sent: Wednesday, April 11, 2001 7:43 PM
> Subject: Re: [smarty] how to use one file for static sites...
>
> > > I couldn't figure out how to do this by smarty. For dynamic pages smarty
> > is
> > > a good idea, but i don't want to use two files for every page.
> >
> > What two files do you mean? You don't need two files...
>
> we do need a tpl and a php file for each web page right?
> eg, for main page, I need to have an index.php and an index tpl.
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/