looking for most efficient solution

From: Date: Wed, 12 Feb 2003 17:00:28 +0000
Subject: looking for most efficient solution
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7688@lists.php.net to get a copy of this message
Hi all. I have a rather intersting dilemma and couldn't extrapolate an anwer from the docs or faqs. I have orders of types say.. A and B which have display formats and variables specific to each. A-orders and B-orders are often displayed in a mixed collection and on multiple pages. Ideally I would have templates for display of each order type and could include them in my other templates approriately. Something like... {foreach from=$orders item=order} {if $order->type == 'A'} {include file='A.tpl'} {else if $order->type == 'B'} {include file='B.tpl'} {/if} {foreach} My dilemma is... Would each iteration of the foreach incur a disk hit at the includes? If so, this would obviousely slow an already taxed system. Would caching help? The documentation says the *output* of the template is cached, but the values of the variables A.tpl or B.tpl would display are dynamic and as such their output would be dynamic as well. I'd appreciate any input/suggestions ya'll might have. Thanks, Raquel

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