Hello, On Thu, Jan 27, 2011 at 7:06 PM, Tobias Schlitt <[email protected]> wrote:
> Hi, > > I made a patch to expose DateTime stuff in the Template language. Please > find it for review here: > > https://issues.apache.org/jira/browse/ZETACOMP-50 > > I posted another patch (with explanations) in the comment. > 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? > > I am not sure if we should avoid an inconvenience by an auto-magic feature. Have a nice day :) -- Jérôme Renard http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard
