RE: [Templates] DBI attribute problem
[prev]
[thread]
[next]
[Date index for 2004/06/14]
Perrin wrote:
> On Mon, 2004-06-14 at 16:01, Jason Gottshall wrote:
> > The perl syntax is:
> >=20
> > $dbh->{LongReadLen} =3D 10000;
> >=20
> > which I write in TT as:
> >=20
> > [% dbh.LongReadLen =3D 10000 %]
> >=20
> > which doesn't work.
>=20
> This might work:
> [% dbh.STORE('LongReadLen', 10000) %]
Indeeed it does. So is dbh really a tied hashref?
> Or you could just use a [% PERL %] section if you have that on. =20
Yeah, it's on, but I want to minimize the amount of embedded perl,
especially since I want these templates to be as friendly as possible
for my non-programmer page designers.
> I think it would be better to do it before the template though. There
isn't
> usually a reason to have lots of different values for this setting,
and
> this is exactly the kind of thing that doesn't belong in templates.
Normally we try to avoid doing too much low-level database interaction
at the template level, but we've found that TT is great for fast
prototyping of new features and direct access to dbi is very handy. I
definitely want to avoid using this in production as much as possible.
Thanks for the "STORE" hint. That saves me a lot of headaches!
Jason
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
RE: [Templates] DBI attribute problem
Jason Gottshall 20:54 on 14 Jun 2004
|