Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Passing data to globals, no tags

Quote Reply
Passing data to globals, no tags
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.
Subject Author Views Date
Thread Passing data to globals, no tags pugdog 5382 Dec 2, 2004, 11:43 PM
Thread Re: [pugdog] Passing data to globals, no tags
Andy 5315 Dec 3, 2004, 12:19 AM
Thread Re: [Andy] Passing data to globals, no tags
pugdog 5294 Dec 3, 2004, 12:37 AM
Thread Re: [pugdog] Passing data to globals, no tags
afinlr 5283 Dec 3, 2004, 10:13 AM
Thread Re: [afinlr] Passing data to globals, no tags
pugdog 5269 Dec 4, 2004, 8:32 PM
Thread Re: [pugdog] Passing data to globals, no tags
webmaster33 5133 Jan 17, 2006, 11:21 AM
Thread Re: [webmaster33] Passing data to globals, no tags
Andy 5173 Jan 18, 2006, 12:03 AM
Thread Re: [Andy] Passing data to globals, no tags
webmaster33 5107 Jan 18, 2006, 3:42 AM
Thread Re: [webmaster33] Passing data to globals, no tags
Andy 5167 Jan 18, 2006, 3:55 AM
Post Re: [Andy] Passing data to globals, no tags
webmaster33 5107 Jan 18, 2006, 4:11 AM
Post Re: [pugdog] Passing data to globals, no tags
webmaster33 5124 Jan 17, 2006, 10:37 AM
Post Re: [pugdog] Passing data to globals, no tags
webmaster33 5151 Jan 17, 2006, 11:13 AM