Re: [SMARTY] Smarty, associative arrays and underscores not playing nicely

From: Date: Sat, 11 Oct 2003 19:53:07 +0000
Subject: Re: [SMARTY] Smarty, associative arrays and underscores not playing nicely
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10342@lists.php.net to get a copy of this message
On Sat, 2003-10-11 at 13:12, Duncan Hill wrote: > On Saturday 11 Oct 2003 17:48, Duncan Hill wrote: > > On Saturday 11 Oct 2003 17:45, Monte Ohrt wrote: > > > Duncan Hill wrote: > > > >Still can't get sections to work with non-numeric indices though, and > > > > that's a critical sticking point for me right now. > > > > > > {section} expects numeric indices. try {foreach} instead. > > > > Oh.. yay. I must be really code-blind, because the manual I have says > > nothing at all about that. Ahh, it's just -barely- hinted at with the part > > about start and step, but there's no explicit declaration that section > > requires a numeric index. Oh well, live and learn. > > Thanks all who responded. I ended up using a php foreach to re-index my two > arrays to the same numeric indices (they shared a common string index), and > am using a section quite happily now. Just a thought (if it applies to your case) but array_values() is probably more efficient to re-index your arrays. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

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