Nesting foreach isn't a problem. The problem is that you have quoted lists in the call to modelFile, and so these won't get evaluated.
Your call to modelFile should be:
There was no need to have the sprintf's in there - you can pass the variables directly. Quoted lists don't evaluate anything within the '(...), whereas the list() function evaluates all its arguments before creating the list.
Andrew.Originally posted in cdnusers.org by adbeckett