Hi all,
I wonder if these abilities may be added?
1) Sort lists of lists
This seems super-easy:
--
459a460,462
>elsif (ref($item) eq 'ARRAY') {
>@keys = map { $item->[ $_ ] } @$fields;
>}
--
2) Sort hashes by key/index
So, if you have
%myhas
Hello,
Is there a way in TT2 that I can access a subroutine reference?
e.g.:
[% do_something( sub_ref ) -%]
sub do_something {
my $sub_ref = shift();
my $obj = shift();
return &{ $sub_ref }( $obj );
}
-FG
--
Felipe Gasper
Linux/BSD development
cPanel of
Hi all,
What is the syntax I am looking for here?
-
FOR key = hash.keys;
"The value for $key is ${hash.$key}.";
END;
-
The above syntax produces errorsI assume there is a way to do what
I want to do?
-F
--
Felipe Gasper
Linux/BSD development
cPanel of Tex
Dave Cross wrote on 22 10 2009 1:52 PM...
> On 10/22/2009 07:31 PM, Felipe Gasper (cPanel) wrote:
>> Hi all,
>>
>> What is the syntax I am looking for here?
>>
>> -
>> FOR key = hash.keys;
>> "The value for $key is ${hash.$key}.
Can this list not be set for an individual subscriber to have
reply-to-all as the default reply option?
I know it can be set that way for the entire list...I just want to set
it that way for myself.
Thanks!
-F
--
Felipe Gasper
Linux/BSD development
cPanel of Texas, LLC
3701 Kirby Dr., suite
Hi all,
Is the practice of doing virtual methods on variable literals something
that was purposely omitted from TT?
In Javascript, for example, you can do this:
var transformed = [1,2,3].someFunc();
...but in TT, you would have to do:
SET transformed = [1,2,3];
transformed = t
Quoth Dermot on 11/4/2009 7:03 AM...
> LID=[% userid %] # This appears correct (EG 1234)
> interpolated=[% $userid %] # This is empty.
> interpolated=[% ${user.id} %] # This is empty.
>
>
>
> I can't seem to get the userid variable interpolated within the call
> to subs.makeUserLink() . $useri
How can I tell what kind of data a given variable is in TT? (Analogous
to ref() in perl.)
-F
--
Felipe Gasper
Linux/BSD development
cPanel of Texas, LLC
3701 Kirby Dr., suite 428
Houston, TX 77098
office 713-529-0800 x4096
cell 832-633-8092
fax 713-559-3206
___
Hello,
It appears that TT is converting an "undef" value that I return from a
function called from a template into the empty string, e.g.:
USE Myplugin;
SET foo = Myplugin.myfunc() %]
sub myfunc { return undef; }
...at least, foo.defined() is evaluating as true in thi
Is there a way to delete a variable from the stash in TT2?
If not, does something let me define a custom directive to do this?
-F
--
Felipe Gasper
Linux/BSD development
cPanel of Texas, LLC
3701 Kirby Dr., suite 428
Houston, TX 77098
office 713-529-0800 x4096
cell 832-633-8092
fax 713-559-3206
COOL!! :)
I am guessing this will be easy to implement if it’s not already, but
will TT3 spit out text “on the fly”, or will it process to a buffer and
then flush in one fell swoop?
The former approach is useful for web interfaces to long-running processes.
-FG
Quoth Andy Wardley on 12/24/2009
We have a custom module to override the undefined() method in the TT
Stash module.
To do the override, we do
eval "require $Template::Config::STASH;";
sub new {
my $this = $Template::Config::STASH->new();
return bless $this, shift();
}
and then
Hello,
If I have the following template code:
--
SET test_hash = {
'keys' => 'foo',
'bar' => 'baz',
};
GET test_hash.keys();
--
...what I get back is “foo” rather than an array reference.
The .items() hash vmethod allows me to specify that I want an ite
Hey all,
What is the best way in TT to add thousands separators to numbers, e.g.
1234567 -> '1,234,567'?
-FG
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
How can I do this from perl:
print "\x{201c}";
...in Template?
-F
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
The INCLUDE and PROCESS directives result in Perl code (in the compiled
template) that goes to the filesystem and retrieves the
INCLUDEd/PROCESSed template at runtime.
Is it possible to have a directive that actually *compiles* the
INCLUDEd/PROCESSed template at compile time and inserts it dire
Don’t forget to wrap the JSON plugin to catch "" in your JSON
string.especially if you’re spitting out data that came from “the wild”.
-FG
On 8/7/10 2:38 PM, Jens Rehsack wrote:
> On 08/06/10 23:46, Tosh Cooey wrote:
>> I have a template that delivers HTML, yay! I would like to have the
>>
How can I do this?
[%
SET included_template = PROCESS 'external.tt2';
-%]
...without having the contents of external.tt2 displayed in the page?
-FG
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/li
If I have:
perl -MTemplate -MTemplate::Stash -le
'Template->new({STASH=>Template::Stash->new()})->process(\"Hi. [%
FOREACH key IN x.keys() %]Key [% key %], [% END
%]",{x=>{a=>2,b=>3,keys=>[4,5,6]}});'
...one would think, not being familiar with TT, that “x.keys()” is a
method call.
As many o
=> 2,
b=> 3,
keys => [4,5,6],
} };
Template->new()->process(\$tt2, $data);
-
I don’t see an RT about thishas there been discussion of this before?
-FG
Felipe Gasper (cPanel) wrote on 27 Oct 2010 14:56 ...
> If I have:
>
> perl -MTemplate -MTempla
Hi all,
According to GitHub, there haven’t been any commits for a year and a
half…I’m just curious, what is the status of TT3?
-Felipe Gasper
Houston, TX
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.or
Sweet! :)
-F
On 7/7/11 11:45 AM, Clinton Gormley wrote:
> On Thu, 2011-07-07 at 11:37 -0500, Felipe Gasper (cPanel) wrote:
>> Hi all,
>>
>> According to GitHub, there haven’t been any commits for a year and a
>> half…I’m just curious, what is the status of TT3
Any interest for a .uri() scalar vmethod, similar to the .html() one
that 2.24 just added?
Seems like it’d be very useful.
-FG
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
Any chance this could make it into a forthcoming TT release?
our $TEXT_VMETHODS = {
...
dquote => \&text_dquote,
html=> \&Template::Filters::html_filter,
xml => \&Template::Filters::xml_filter,
uri => \&Template::Filters::uri_filter,
};
It seems like
On 7/31/12 9:56 AM, Dave Howorth wrote:
Felipe Gasper (cPanel) wrote:
Any chance this could make it into a forthcoming TT release?
our $TEXT_VMETHODS = {
...
dquote => \&text_dquote,
html=> \&Template::Filters::html_filter,
xml => \&
On 11/8/13 10:54 AM, Dave Howorth wrote:
I expect my brain is fried and I'm doing it all wrong, but I'd
appreciate advice about how to access template variables in perl code.
I have a perl function that retrieves some data and returns it. I've put
the function in the stash so I can call it in a
26 matches
Mail list logo