Binders: date

TODO:

 

/**
 * Appcropolis Site Binder: date
 * 
 * Reformat a post/page date
 *
 * @param {array} $params 
 *            $params['format'] 
 *            $params['when'] Post/Page date . If not value is passed, this will return the current date with the provided format.
 *            $params['elapsed'] If set (to any value), it will return the time ago.
 *            $params['daysafter'] Number the of days after present date.
 *            $params['daysbefore'] Number the of days before present date.
 *            $params['assign_to'] Variable withing the template engine to which the content has to be assinged. 
 *
 * 
 * @example
 * 
 * # EXAMPLE 1
 * 
 * {{date format="F j, Y" when="2015-02-27 11:33:20" assign_to="my_date"}}
 * <p>Created on {{$my_date}}</p>
 * 
 * # EXAMPLE 2
 * 
 * {{date elapsed="true" when="2015-02-27 11:33:20" assign_to="time_ago"}}
 * <p>Created {{$time_ago} ago</p>
 * 
 * # EXAMPLE 3
 * 
 * <p>Created {{date when="2015-02-27 11:33:20" elapsed="true"}} ago</p>
 * 
 * # EXAMPLE 4
 * 
 * <p>This post was created {{date when="{{$post.post_date}}" elapsed="true"}} ago</p>
 *
 * 
 * @see http://php.net/manual/en/function.date.php
 *
 */

 

Leave a Reply

Your email address will not be published. Required fields are marked *