
03-14-2011, 11:10 AM
|
|
 | |
|
|
 X-Cart team
|
|
Join Date: Aug 2004
Posts: 907
|
|
|
Re: Help with Smarty
Quote:
Originally Posted by am2003
Sorry for posting here, but there is not section in this forum for Smarty discussions.
I would like to get a solution for this problem. I declare an associative array in a php file and assign it to a Smarty template
Code:
$products = array(
array("name" => "Adidas", "products" => "12"),
array("name" => "Asics", "products" => "8"),
array("name" => "Montrail", "products" => "4"),
array("name" => "New Balance", "products" => "7"),
array("name" => "Puma", "products" => "9"),
array("name" => "Salomon", "products" => "11"),
array("name" => "Vasque", "products" => "6"),
);
$smarty->assign("manufacturers", $manufacturers);
How can I create a table using Smarty, with a specified number of colums, as the following (let's say columns number is 3):
column 1 column 2 column 3
row 1: Adidas Asics Montrail
row 2: 12 8 4
row 3: New Balance Puma Salomon
row 4: 7 9 11
row 5: Vasque
row 6: 6
I know how to do it with 3 rows grouping in a table cell [name] and [products]. This version with 6 rows seems to be complex for me. I appreciate a solution on this.
Thanks!
|
Hmm, I'd try to adapt this code: http://www.smarty.net/forums/viewtopic.php?t=1391
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)
ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer
Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
|
|