/Users/mgirouard/Sites/panda-php/trunk/Panda/View/Abstract.php

Go to the documentation of this file.
00001 <?php 
00002 
00003 require_once 'Panda/View/Interface.php';
00004 
00012 abstract class Panda_View_Abstract
00013 implements Panda_View_Interface
00014 {
00020     protected $data = array();
00021     
00027     protected $echoOutput = true;
00028 
00038     public function getVar($name)
00039     {
00040         if (array_key_exists($name, $this->data)) {
00041             return $this->data[$name];
00042         }
00043         else {
00044             return null;
00045         }
00046     }
00047 
00055     public function setVar($name, $value)
00056     {
00057         return $this->data[$name] = $value;
00058     }
00059 
00065     public function unsetVar($name)
00066     {
00067         if (array_key_exists($name, $this->data)) {
00068             unset($this->data[$name]);
00069         }
00070     }
00071     
00077     public function getData()
00078     {
00079         return $this->data;
00080     }
00081     
00088     public function setData(array $data)
00089     {
00090         $this->data = $data;
00091     }
00092     
00102     public function setEchoOutput($bool)
00103     {
00104         $this->echoOutput = (bool)$bool;
00105     }
00106     
00116     protected function output($output)
00117     {
00118         if ($this->echoOutput) {
00119             echo $output;
00120         }
00121         
00122         return $output;
00123     }
00124 }

Generated on Thu Sep 4 01:56:50 2008 for Panda PHP Components by  doxygen 1.5.4