Not in the Perl. But in the template, the line [% FOREACH project IN worklist(me.id) %] calls worklist as a function with the appropriate ID as its argument.
That confirms what I suspected - thanks
(But it seems to me that you shouldn't need to call a function from the template, unless the data will change based on some parameter from the template, like the me.id argument in the tutorial example. Since you're not feeding anything back to the function, why not just define frames as the arrayref rather than the coderef?)
This is a learning exercise rather than a complete solution. Totally agreed that a function is not needed here yet, but I'm trying to learn how to use functions within Templates so that, when I need them, I have a good grasp of how to implement them.
Update:
probably like [% FOREACH frame IN frames() %] (untested)
Yes - that is the part I omitted...thanks, that gets me further.
The subroutine is now being called. However, the values are not being passed back to the Template. Or, if they are, they are not getting displayed.
In reply to Re^4: Preparing data for Template
by Bod
in thread Preparing data for Template
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |