[PHPTAL] implode()

GRolf gerolf at pictureparking.com
Fri Oct 29 09:23:42 CEST 2010


I often find myself using tal:repeat to implode an array

in php
$myarr = array('one', 'two', 'three');

is easily converted to
one, two, three

with 
implode(', ',$myarr);


But in PHPTal, this is quite cumbersome

<span tal:repeat="val myarr">
${val}<span tal:condition="not:repeat/val/end">, </span>
</span>

Isn't there an easier solution? 





More information about the PHPTAL mailing list