[Maypole] request.foo is erratic in TT
Stuart Robinson
stuart.robinson@connect-2.co.uk
Mon, 21 Jun 2004 01:06:53 +0100
Hi,
I'm having problems using 'request' object variables in TT templates.
Some variables are fine and their value is inserted into the template
but others disappear, with nothing inserted. All are simple [%
request.foo %] statements.
These work:
request.model_class
request.template
request.action
These do not:
request.table
request.path
request.method_attribs
The really weird thing is that when I do Data::Dumper dumps [1] of the
request object from inside Maypole (I tried in a 'sub addition_data' and
from inside TT.pm) it tells that all the values are set. This is rather
confusing.
If I set: $r->{template_args}{path} = $r->{path};
in 'sub additional_data' then I can use [% path %] in the template, and
it works, but hacking round something that is mysteriously broken
doesn't feel right.
Does anybody have any idea what is happening here? Or any ways to dig
deeper. I'm running out of ideas and the frustration is killing me.
Thanks very much in advance,
Stu
== [1] Partial output from Data::Dumper ===
$VAR1 = 'request';
$VAR2 = bless( {
'method_attribs' => 'Exported',
'model_class' => 'Tidal::Blog',
'template' => 'list',
'query' => {},
'args' => [],
'table' => 'blog',
'path' => 'blog/list/',
'ar' => bless( do{\(my $o = 137460028)},
'Apache::Request' ),
'params' => {},
'objects' => [ ],
'action' => 'list',
...