incubator-zeta-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Schlitt <>
Subject [zeta-dev] Patch: DateTime functionality for Template
Date Thu, 27 Jan 2011 18:06:17 GMT

I made a patch to expose DateTime stuff in the Template language. Please
find it for review here:

It basically just exposes the procedural interface (where exists) of
DateTime to the template language.

There is one open issue, which needs to be discussed: DateTime
modification functions, such as date_sub() and friends, return the
modified DateTime object in addition. This requires an assignement
whenever these functions are used in a template. For example::

	{$foo = date_sub( $date, $interval )}

Otherwise, the Template engine would attempt to convert the returned
object to a string for output.

To avoid this inconvenience, I'd suggest to wrap the DateTime functions
and eat the return value. This means a slide variation from the behavior
known from PHP, but much more convenience for template authors.

What do you think?


Tobias Schlitt        GPG Key: 0xC462BC14
Want to hire me? Need quality assurance?  
eZ Components are Zeta Components now!

View raw message