On 29-12-2009 at 22:06:13 romtek <rom...@gmail.com> wrote:

I was looking for a more elegant way to generate grids using PHPTAL that
what I've been using and stumbled upon this post:
http://lists.motion-twin.com/pipermail/phptal/2007-February/000730.html. In
it, Aaron McClimont has proposed adding a "while" loop (and also
dowhile)construct to PHPTAL. I think it's very valuable as it allows for
much more elegant code in certain situations. Has this been added to the
library? If not, could it be?

Are there any other uses for while?

Variable number of columns can be done more elegantly than by _copying & pasting_ code, and it can even vary at run time:

<tr tal:repeat="row php:array_chunk(data, number_of_columns)">
  <td tal:repeat="col row" tal:content="col" />
</tr>


--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to