This drove me crazy, until I remembered something from an earlier plugin. I couldn't find it in the docs, either.
Either it's a bug, or it's an overlooked concept that should be investigated.
If you pass parameters to a global:
<%global_name ('param1', 'param2')%>
No tags are passed.
The first element in the passed array, is *not* the tags.
You have to do a
sub {
my $tags = GT::Template->tags;
...
etc
}
And, that's not documented anywhere I could find.
For consistency, and uniformity with OOP, shouldn't the first parameter *always* be the same?
When calling a method, the first parameter is always 'self', when calling a sub from inside the templates, the first parameter should *always* be "tags" ... whether params are passed or not.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Either it's a bug, or it's an overlooked concept that should be investigated.
If you pass parameters to a global:
<%global_name ('param1', 'param2')%>
No tags are passed.
The first element in the passed array, is *not* the tags.
You have to do a
sub {
my $tags = GT::Template->tags;
...
etc
}
And, that's not documented anywhere I could find.
For consistency, and uniformity with OOP, shouldn't the first parameter *always* be the same?
When calling a method, the first parameter is always 'self', when calling a sub from inside the templates, the first parameter should *always* be "tags" ... whether params are passed or not.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.