Location: PHPKode > scripts > UI Template > ui-template/frea/Template/Dom/Namespace/Component.php
<?php
/**
 * @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_Dom_Namespace_Component extends Template_Dom_Namespace
{
	public function insertBefore()
	{

		
		$cmp = "<?php
\$cmp = Template_ComponentManager::getComponent(\"{$this->node->getAttribute("use")}\");
";
		$attrs = $this->node->getAttributes();
		foreach($attrs as $name=>$value)
		{
			if($name!="use")
			{
				if(substr($value,0,1)=="\$")
				{
					$cmp .= "\$cmp->".str_replace("-","_",$name)." = Template_VariableContainer::get(\"\\$value\");";
				}
				elseif(substr($value,0,1)=="@")
				{
					$cmp .= "\$cmp->".str_replace("-","_",$name)." = Template_VariableContainer::get(\"$value\");";
				}
				else 
				{
					$cmp .= "\$cmp->".str_replace("-","_",$name)." = \"{$value}\"; ";
				}
			}
		}
		$cmp .= "\$cmp->init(); \n?>";
		return $cmp;
	}
	public function insertAfter()
	{
		
	}
}
Return current item: UI Template