RE: [Templates] Stringifying objects in templates

[prev] [thread] [next] [Date index for 2004/10/25]

From: Jason Gottshall
Subject: RE: [Templates] Stringifying objects in templates
Date: 19:28 on 25 Oct 2004
> In the template I wanted to take the stringified class_date object
> ("2004-10-25 09:00:00") and split on the white space to get the
> individual day and hour components. My first thought was:
>=20
>   [day, time] =3D schedule.class_date.split(' ');
>=20
> But this tried calling the split() method on the Class::Date object
> rather than the stringified version.

What about forcing a stringify like this:

[% myclassdate =3D "${schedule.class_date}" %]
[% [day, time] =3D myclassdate.split(' ') %]

Haven't tried it myself, but it might do the trick.=20

Jason

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Stringifying objects in templates
Drew Taylor 14:26 on 25 Oct 2004

RE: [Templates] Stringifying objects in templates
Jason Gottshall 19:28 on 25 Oct 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52