The Smarty loop works fine like so:
<{section name="ingredients" start=0 loop=9}>
<tr>
<td><input type="text" name="ingred[]" size="30"></td>
<td><input type="text" name="ingred[]" size="30"></td>
</tr>
<{/section}>
But gives me a nasty error like so:
<{section name="ingredients" start=0 loop=9}>
<tr>
<td><{$addrecipeform.elements.ingred[].body}></td>
<td><{$addrecipeform.elements.ingred[].body}></td>
</tr>
<{/section}>
Fatal error: Smarty: [in db:addrecipe_form.html line 20]: syntax error: unrecognized tag: $addrecipeform.elements.ingred[].body (Smarty_Compiler.class.php, line 382) in /Library/WebServer/Documents/xoops/class/smarty/Smarty_Compiler.class.php on line 1824
Displays fine if I get rid of the [] in the element name, except then the database insert fails (of course!). I really don't want to get involved in complex array loading from POST variables.
Tried escaping the brackets, and it skipped the loop altogether. Oh, well...I'll just go with the first loop, while this is a lot of fun learning, I would like to move ahead with this module.
Thanks!