Re: [SMARTY] nested section?

From: Date: Thu, 13 Feb 2003 01:34:53 +0000
Subject: Re: [SMARTY] nested section?
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7707@lists.php.net to get a copy of this message
In article <1045092464.29005.92.camel@lena.ispi.prv>, monte@ispi.net (Monte Ohrt) wrote: > {foreach from=$stores key=store item=stinfo} > {$store} > {foreach from=$stinfo item=item} > <a href="{$item.href}">{$item.name}</a> > {/foreach} > {/foreach} > > Monte Thank you, Monte, for putting up with my apparent shortsightedness... I don't get it. The following test.php and test.tpl don't produce any output. The header and footer are there, the body is empty. No error messages. Steve -----------Smarty/test.php--------------------------------------- <?php require 'Smarty.class.php'; $smarty = new Smarty; $smarty->compile_check = true; $smarty->debugging = true; $stores = Array ( "Abc" => Array ( Array ( "href" => "dealer.php?id=18", "name" => "Alpha Services", ), Array ( "href" => "dealer.php?id=19", "name" => "Beta Testers", ), Array ( "href" => "dealer.php?id=20", "name" => "Gamma Technology", ), ), "Bcd" => Array ( Array ( "href" => "dealer.php?id=21", "name" => "Alpha Tech", ), Array ( "href" => "dealer.php?id=22", "name" => "Beta Office", ), Array ( "href" => "dealer.php?id=23", "name" => "Gamma Centre", ), ), ); $smarty->display('test.tpl'); ?> ------------------------------------------------------------------ -----------Smarty/Templates/test.tpl-------------------------- {include file="header.tpl" title=test} {foreach from=$stores key=region item=local_stores} {$region} {foreach from=$local_stores item=store} <a href="{$store.href}">{$store.name}</a> {/foreach} {/foreach} {include file="footer.tpl"} ------------------------------------------------------------------ -- steve@conceptualthink.com

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