Tutorials » @EVAL Bindings

@EVAL Bindings

Ditto supports the @EVAL binding to evaluate php expressions in filter clauses. The php expression should return the value to be used as the clause and must have proper php syntax (all statements must end with a semi-colon, etc.). Thus, @EVAL time(); is the correct syntax to get the current unix timestamp as described in the documentation.

Example

This call will retrieve all documents in the last year.

[!Ditto?parents=`2`&debug=`1`&display=`all`&filter=`createdon,@EVAL return strtotime('-1 year');,6`!]