View Single Post
  #1  
Old 03-14-2011, 10:05 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Help with Smarty

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!
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote