Location: PHPKode > scripts > UI Template > ui-template/frea/Template/Component.php
<?php
/**
 * Template component class
 *
 * @package frea-framework
 * @subpackage Template
 * 
 * @copyright 2009 frea-framework
 * @author Dawid Kraczkowski hide@address.com
 * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
 */
class Template_Component
{
	/**
	 * component's contents
	 *
	 * @var string
	 */
	private $contents;
	/**
	 * hold all params
	 *
	 * @var array
	 */
	private $params;
	/**
	 * hold values for params
	 *
	 * @var array
	 */
	private $values;
	/**
	 * fetch component with contents
	 *
	 * @param string $contents
	 */
	public function defineContents($contents)
	{
		$this->contents = $contents;
	}
	/**
	 * add a param to component
	 *
	 * @param string $name
	 */
	public function addParam($name)
	{
		$this->params[] = $name;
	}
	/**
	 * set a value for param
	 *
	 * @param string $name
	 * @param mixed $value
	 */
	public function __set($name,$value)
	{
		$this->values[$name] = $value;
	}
	/**
	 * get param for component
	 *
	 * @param string $name
	 * @return mixed
	 */
	public function __get($name)
	{
		return $this->values[$name];
	}
	/**
	 * init component
	 *
	 * @return string
	 */
	public function init()
	{
		return eval("?>".$this->contents);
	}
}
Return current item: UI Template