[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/view/src/ -> lmbView.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  /**

  11   * abstract class lmbView.

  12   *

  13   * @package view

  14   * @version $Id$

  15   */
  16  abstract class lmbView
  17  {
  18    protected $template_name;
  19    protected $variables = array();
  20  
  21    function __construct($template_name = '')
  22    {
  23      $this->template_name = $template_name;
  24    }
  25  
  26    function setTemplate($template_name)
  27    {
  28      $this->template_name = $template_name;
  29    }
  30  
  31    function hasTemplate()
  32    {
  33      return $this->template_name != '';
  34    }
  35  
  36    abstract function render();
  37  
  38    function reset()
  39    {
  40      $this->variables = array();
  41    }
  42  
  43    function getTemplate()
  44    {
  45      return $this->template_name;
  46    }
  47  
  48    function set($variable_name, $value)
  49    {
  50      $this->variables[$variable_name] = $value;
  51    }
  52  
  53    function setVariables($vars)
  54    {
  55      $this->variables = $vars;
  56    }
  57  
  58    function get($variable_name)
  59    {
  60      if(isset($this->variables[$variable_name]))
  61        return $this->variables[$variable_name];
  62    }
  63  
  64    function getVariables()
  65    {
  66      return $this->variables;
  67    }
  68  }
  69  ?>


Generated: Tue Oct 14 04:47:40 2008 Cross-referenced by PHPXref 0.7