As a result, Kevin wrote two plugins we're happy to release under a BSD/Open Source License to the Smarty developer community:
split:
Split works much like "foreach" but instead of iterating over the array an element at a time, it iterates over a set of subarrays of roughly equal size. The motivation is to allow multicolumn layouts without either a lot of ugly smarty markup or requiring the generating page to handle breaking the array down for the column display (which requires encoding the number of columns in the php code).
split_row:
Like split, split_row is a foreach-like structure that returns parts of an array for the purpose of doing mulicolumn layouts. The difference is that split_row returns the values in row order instead of column order.
Feel free to poke at it and give us feedback in comments.
1 comment:
It's not work for me, it will print only first row. Please help.
Post a Comment