Zikula_Template_Plugins
[ class tree: Zikula_Template_Plugins ] [ index: Zikula_Template_Plugins ] [ all elements ]

Source for file function.dateformat.php

Documentation is available at function.dateformat.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2004, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.dateformat.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @author Robert Gasch
  10.  * @package Zikula_Template_Plugins
  11.  * @subpackage Functions
  12.  */
  13.  
  14. /**
  15.  * DateFormat
  16.  *
  17.  * @author       Robert Gasch
  18.  * @version    $Id: function.dateformat.php 24342 2008-06-06 12:03:14Z markwest $
  19.  * @param       format          The date format we wish to convert to (optional) (default='Y-m-d')
  20.  * @param       datetime        The datetime we wish to convert
  21.  * @param       assign          The smarty variable we wish to assign the result to (optional)
  22.  */
  23. function smarty_function_dateformat ($params&$smarty)
  24. {
  25.     Loader::loadClass('DateUtil');
  26.  
  27.     $res null;
  28.     if (isset($params['format']&& $params['format']{
  29.         $res DateUtil::formatDatetime ($params['datetime']$params['format']);
  30.     else {
  31.         $res DateUtil::formatDatetime ($params['datetime']DATEFORMAT_FIXED);
  32.     }
  33.  
  34.     if (isset($params['assign']&& $params['assign']{
  35.         $smarty->assign ($params['assign']$res);
  36.     else {
  37.         return $res;
  38.     }
  39. }

Documentation generated on Fri, 18 Jul 2008 21:45:13 +0200 by phpDocumentor 1.4.1