У меня есть мой php-код, подобный следующему:
$products = mysql_query("SELECT p.* FROM products AS p "
."INNER JOIN products_cat_link AS cpl ON cpl.Product_ID = p.id "
."WHERE cpl.Category_ID = '$forcat' "
."ORDER BY p.id");
$products_row = array();
$products_images = array();
while($prow = mysql_fetch_assoc($products)) {
if (isset($prow['id'])) {
$product['info'] = $prow;
$images = mysql_query("SELECT * FROM products_images WHERE `Product_id` = '$prow[id]' ORDER BY id");
while($irow = mysql_fetch_assoc($images)) {
$images_result[] = $irow;
}
$product['images'] = $images_result;
$products_images[] = $product;
}
$product = '';
$images_result = '';
}
$smarty->assign('products_images',$products_images);
, который создает такой массив
Array (
[info] => array (
[id] = 1
[name] = abc
)
[images] => array (
[Products_Image_Thumb] = 1a.jpg
[Products_Image_Big] = 1b.jpg
)
)
Но я не могу получить информацию об изображениях с smarty:
{foreach from=$products_images key=cols item=image name=images}
{if $cols % 4 == 0}<div>{/if}
<a href="images/products/big/{$image.images.Products_Image_Big}">
<img src="images/products/thumb/{$image.images.Products_Image_Thumb}" alt="Click to Enlarge" title="Click to Enlarge" width="87" height="65" style="margin:3px;" /></a>
{if $cols % 4 == 3}</div>{/if}
{if $smarty.foreach.images.last}</div>{/if}
{/foreach}
Спасибо за любую помощь!