AW: [SMARTY] includes
| From: | Ben | Date: | Thu, 02 Sep 2004 16:18:39 +0000 |
| Subject: | AW: [SMARTY] includes | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11758@lists.php.net to get a copy of this message | ||
In fact that there is no else, maybe you don't need to handle
that because of there can't be anything else as value for
$report_type, why don't you just try sth. like
{include file="reports.".$report_type.".inc.html"}
or
{include file="reports.$report_type.inc.html"}
But i didn't try it and i don't know if smarty can
parse vars that way...
-----Ursprüngliche Nachricht-----
Von: pete M [mailto:pmorgan@ukds.net]
Gesendet: Donnerstag, 2. September 2004 16:17
An: smarty-general@lists.php.net
Betreff: [SMARTY] includes
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
---
__________________________________________________________
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.08.2004
---
__________________________________________________________
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.08.2004