Location: PHPKode > scripts > UI Template > ui-template/frea/Template/ComponentManager.php
<?php
/**
 * Holds all registered components
 *
 * @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_ComponentManager
{
	/**
	 * holds components
	 *
	 * @var array
	 */
	static protected $componentsContainer;
	/**
	 * register a new component
	 *
	 * @param string $componentname
	 * @param Template_Component $component
	 */
	static public function registerComponent($componentname,Template_Component $component)
	{
		self::$componentsContainer[$componentname] = &$component;
	}
	/**
	 * get a registered component
	 *
	 * @param string $componentname
	 * @throws Template_Exception
	 * @return Template_Component
	 */
	static public function getComponent($componentname)
	{
		if(isset(self::$componentsContainer[$componentname]))
		{
			return self::$componentsContainer[$componentname];
		}
		else 
			throw new Template_Exception("Component '{$componentname}' not defined!");
	}
}
Return current item: UI Template