Source for file Template.class.php

Documentation is available at Template.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Template
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Template Interface, defines global Template properties
  22.  *
  23.  * @category Gumbo
  24.  * @package Template
  25.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  26.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  27.  * @author Michael Luster <mluster79@yahoo.com>
  28.  * @link http://sourceforge.net/projects/phpgumbo
  29.  * @desc Template Interface
  30.  * @version 0.0.1
  31.  */
  32.  
  33.     
  34.     
  35.     
  36.     /** ACTION METHODS **/
  37.     /**
  38.      * Assigns a global template variable
  39.      * 
  40.      * All global template variable references will be prepended with
  41.      * "global_*" string.  This will separate the global variables from
  42.      * local template variables.
  43.      * 
  44.      * @precondition must be a primitive type
  45.      * @param string|array$key template reference
  46.      * @param mixed $val template value
  47.      */
  48.     public static function assign ($key$val=null);
  49.     
  50.     /**
  51.      * Removes the global variable assignment
  52.      * @param string $key template variable reference
  53.      */
  54.     public static function unassign ($key);
  55.     
  56.     
  57.     
  58.     /** MUTATOR METHODS **/
  59.     /**
  60.      * Sets the global template engine to use
  61.      * @param string $engine 
  62.      */
  63.     public static function setEngine ($engine);
  64.     
  65.     /**
  66.      * Sets the global template file directory
  67.      * @precondition is_dir ($loc)
  68.      * @param string $loc 
  69.      */
  70.     public static function setDirTpl ($loc);
  71.     
  72.     /**
  73.      * Sets the global template file compile directory
  74.      * @precondition is_dir ($loc)
  75.      * @param string $loc 
  76.      */
  77.     public static function setDirCompile ($loc);
  78.     
  79.     /**
  80.      * Sets the global template file cache directory
  81.      * @precondition is_dir ($loc)
  82.      * @param string $loc 
  83.      */
  84.     public static function setDirCache ($loc);
  85.     
  86.     /**
  87.      * Sets the global template file config directory
  88.      * @precondition is_dir ($loc)
  89.      * @param string $loc 
  90.      */
  91.     public static function setDirConfig ($loc);
  92.     
  93.     /**
  94.      * Sets the global left delimeter value
  95.      * @param string $val 
  96.      */
  97.     public static function setLeftDelimeter ($val);
  98.     
  99.     /**
  100.      * Sets the global right delimeter value
  101.      * @param string $val 
  102.      */
  103.     public static function setRightDelimeter ($val);
  104.     
  105.     
  106.     
  107.     /** ACCESSOR METHODS **/
  108.     /**
  109.      * Returns the global template engine
  110.      * @return string 
  111.      */
  112.     public static function getEngine ();
  113.     
  114.     /**
  115.      * Returns a global template variable value
  116.      * @param string $key variable reference
  117.      * @return mixed 
  118.      */
  119.     public static function getVar ($key);
  120.     
  121.     /**
  122.      * Returns all the global template variables
  123.      * @return array 
  124.      */
  125.     public static function getVars ();
  126.     
  127.     /**
  128.      * Returns the global Template directory
  129.      * @return string 
  130.      */
  131.     public static function getDirTpl ();
  132.     
  133.     /**
  134.      * Returns the global Template compile directory
  135.      * @return string 
  136.      */
  137.     public static function getDirCompile ();
  138.     
  139.     /**
  140.      * Returns the global Template cache directory
  141.      * @return string 
  142.      */
  143.     public static function getDirCache ();
  144.     
  145.     /**
  146.      * Returns the global Template config directory
  147.      * @return string 
  148.      */
  149.     public static function getDirConfig ();
  150.     
  151.     /**
  152.      * Returns the global left delimeter
  153.      * @return string 
  154.      */
  155.     public static function getLeftDelimeter ();
  156.     
  157.     /**
  158.      * Returns the global right delimeter
  159.      * @return string 
  160.      */
  161.     public static function getRightDelimeter ();
  162.     
  163.     
  164.     
  165.     /**
  166.      * Returns if the Template Engine exists
  167.      * @param string $engine 
  168.      * @return bool 
  169.      */
  170.     public static function isEngine ($engine);
  171.     
  172. }
  173.  
  174. ?>