Re: Multiple web pages in one file
| From: | Johann | Date: | Mon, 08 Jul 2002 08:08:28 +0000 |
| Subject: | Re: Multiple web pages in one file | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5221@lists.php.net to get a copy of this message | ||
On 8 lipca 2002 at 09:41:37
Peter Turcan <peter.turcan@zoznam.sk>
wrote:
> I'am building my web site. It is framed.
> For each targed html I have one php file and one template.
> Is it possible to reduce ammount of files? I know, that templates have
> to be separeted. But how did you solve the problem with many php
> files? I want to have only one php file and depends on something
> display different template.
I am using only one index.php file and many subtemplates with their
own php files.
index.php:
require_once "setup.php"; # smarty paths, etc
$tpl->display('main.tpl');
main.tpl:
{include_php file="main.php"}
{include file="header.tpl}
{include file="content.tpl}
{include file="footer.tpl}
content.tpl:
{include_php file="content.php"}
{if $varFromMyPhp}
{include file="another.tpl" param=$paramFromMyPhp}
{/if}
...
etc., etc.
Every template and its subtemplate has its own php file (if it is
necessery)
--
Johann