Re: [SMARTY] includes
| From: | Bill Cunningham | Date: | Thu, 02 Sep 2004 15:33:12 +0000 |
| Subject: | Re: [SMARTY] includes | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11756@lists.php.net to get a copy of this message | ||
Pete,
Why can't you simply do this:
{include file="reports.$report_type.inc.html"} or
{inlcude file="reports.".$report_type.".inc.html"}
Smarty should translate the report_type in the quotes.
I dunno I haven't tried this so....
- Bill
--- pete M <pmorgan@ukds.net> wrote:
> is there a more elegant way to code below..The variable
> companed is also
> tpart of the file name
>
> {if $report_type == 'general'}
> {include file="reports.general.inc.html"}
>
> {elseif $report_type == 'ppm'}
> {include file="reports.ppm.inc.html"}
>
> {elseif $report_type == 'finance'}
> {include file="reports.finance.inc.html"}
>
> {elseif $report_type == 'testing'}
> {include file="reports.testing.inc.html"}
> {/if}
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
=====
William Cunningham
Cell: (775) 848-5929
http://www.cunndev.net