Re: [SMARTY] includes

From: Date: Thu, 02 Sep 2004 23:26:54 +0000
Subject: Re: [SMARTY] includes
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11762@lists.php.net to get a copy of this message
--- Monte Ohrt <monte@ispi.net> wrote: > {if strstr($report_type ne ""} > {include file="reports.$report_type.inc.html"} > {/if} Hmm. It seems to me that he wants to do two things: check $report_type against a range and if it is valid, then include a report. I would might do something like: > {if strpos("general||ppm||finance||testing||", "$report_type >||")} > {include file="reports.$report_type.inc.html"} > {/if} Still, it seems more reasonable that this can be handled in the PHP controller. xo boots > pete M 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} > > >

« previous php.smarty.general (#11762) next »