[Development] How todo a foreach loop?

In my controller I have:

$query = db_res('SELECT * FROM movie');

while( $item = mysql_fetch_assoc($query))

{$movies[] = $item; }

return $tpl->parseHtmlByName('cinema2.html', array('movies' => $movies));

then in my template I have:

<ul>
<bx_repeat:movies>
<li>__title__</li>
</bx_repeat:movies>
</ul>

and I get nothing but one loop and no title.


Anyone have doc on how todo it? or help

Quote · 25 Jan 2010

The answer is that it should be: return $tpl->parseHtmlByName('cinema2.html', array('bx_repeat:movies' => $movies));

Quote · 25 Jan 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.