Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: patTemplate

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /pattemplate/patTemplate/Function/Time.php

Documentation is available at Time.php

  1. <?PHP
  2. /**
  3.  * patTemplate function that calculates the current time
  4.  * or any other time and returns it in the specified format.
  5.  *
  6.  * $Id: Time.php 95 2004-04-06 18:50:25Z schst $
  7.  *
  8.  * @package        patTemplate
  9.  * @subpackage    Functions
  10.  * @author        Stephan Schmidt <[email protected]>
  11.  */
  12.  
  13. // Check to ensure this file is within the rest of the framework
  14. defined('JPATH_BASE'or die();
  15.  
  16. /**
  17.  * patTemplate function that calculates the current time
  18.  * or any other time and returns it in the specified format.
  19.  *
  20.  * $Id: Time.php 95 2004-04-06 18:50:25Z schst $
  21.  *
  22.  * @package        patTemplate
  23.  * @subpackage    Functions
  24.  * @author        Stephan Schmidt <[email protected]>
  25.  */
  26. {
  27.    /**
  28.     * name of the function
  29.     * @access    private
  30.     * @var        string 
  31.     */
  32.     var $_name    =    'Time';
  33.  
  34.    /**
  35.     * call the function
  36.     *
  37.     * @access    public
  38.     * @param    array    parameters of the function (= attributes of the tag)
  39.     * @param    string    content of the tag
  40.     * @return    string    content to insert into the template
  41.     */
  42.     function call$params$content )
  43.     {
  44.         if!empty$content ) )
  45.         {
  46.             $params['time'$content;
  47.         }
  48.  
  49.         ifisset$params['time') )
  50.         {
  51.             $params['time'strtotime$params['time');
  52.         }
  53.         else
  54.         {
  55.             $params['time'time();
  56.         }
  57.  
  58.  
  59.         return date$params['format']$params['time');
  60.     }
  61. }
  62. ?>

Documentation generated on Mon, 05 Mar 2007 21:29:23 +0000 by phpDocumentor 1.3.1