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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Andy] Pass var to global: Edit Log

Here is the list of edits for this post
Re: [Andy] Pass var to global
That is more nice than my version of "var1,var2,var3" and a split inside the global.
Thank you very much.

Now i try the opposite way.
Code:

For example, assume a variable named ``person'' has been passed to the template parser with a value of:
{ name => "John Doe", age => 35, hair => "brown" }
The following example:
<%person.name%> is <%person.age%> and has <%person.hair%> hair.



Because of different reasons i have to pass all my text-fields to utf: (I know that i could change the setting inside lsql)

global utf_Title
Code:
sub {
my $tags = shift;
my $tmp= $tags->{Title};
utf8::encode($tmp);
return $tmp;
}

i would like to have:

global utf_all
Code:
sub {
my $tags = shift;
foreach $tags as $key=>$value {
utf8::encode($tags[$key]);
}
return @tags
}

Then in template i use <%tags.title%>

I will give it a try now.

Maybe it would be better to make the utf-translation directly in the script and just use the normal <%field%>?

Last edited by:

Robert: May 11, 2016, 4:29 AM

Edit Log: