Hi,
I am having trouble with, what I'm sure, is a simple problem.
I am executing process in this fashion
$tt->process('subdir/page',
{
user => {
id=> $userid, # some var defined earlier (EG 1234).
},
subs => {
makeUserLink => \&somFunc
Dermot wrote:
Can anyone offer any hints?
Template variables don't start with a dollar ?!
___
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
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
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi guys,
I have a problem regarding data defined inside the META tag.
For example I have the following at the start of a template file:
- ---8<---
[%= META
dest = '/etc/motd'
user = 'root'
group= 'root'
mode = 444
revision
2009/11/4 Felipe Gasper (cPanel) :
> 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
On Wed, Nov 4, 2009 at 5:03 AM, Dermot wrote:
> Hi,
>
> I am having trouble with, what I'm sure, is a simple problem.
>
> I am executing process in this fashion
>
> $tt->process('subdir/page',
> {
> user => {
> id=> $userid, # some var defined earlier (EG 1234).
> }
Dermot wrote:
> I have used $ with reference to
> http://template-toolkit.org/docs/manual/Variables.html#section_Variable_Interpolation
> but if I mis-reading the docs please let me know.
You are misreading them. Use:
[% subs.makeLink(lid=>lightbox.lid, perpage=>p) %]
However, if you need this
2009/11/4 "Hendrik T. Völker"
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi guys,
>
> I have a problem regarding data defined inside the META tag.
>
> For example I have the following at the start of a template file:
>
> - ---8<---
> [%= META
> dest = '/etc/motd'
> user = 'ro
2009/11/4 Josh Rosenbaum :
> Dermot wrote:
>>
>> I have used $ with reference to
>>
>> http://template-toolkit.org/docs/manual/Variables.html#section_Variable_Interpolation
>> but if I mis-reading the docs please let me know.
>
>
> You are misreading them. Use:
>
> [% subs.makeLink(lid=>lightbox.li
> 2009/11/4 Josh Rosenbaum :
> > So you may need to use this instead if your subroutine is not expecting a
> > hashref:
> > [% subs.makeLink('lid', lightbox.lid, 'perpage', p) %]
>
I think this is what you're missing. Use commas instead of '=>' then your
function should get the list it is expectin
Dermot wrote:
> sub someFunc {
> use Data::Dumper;
> print STDERR Dumper(@_);
> print STDERR "Last el=". ref($_[-1])."\n";
> my $args = (ref($_[-1]) eq 'HASH') ? pop : @_;
> foreach (keys %{$args}) {
> print STDERR "someFunc: $args->{$_} => $_\n";
> }
> }
> I have a
11 matches
Mail list logo