public function insert($name, array $data=null)
	{
		/** @var Template $tpl */
		if ($this instanceof Template)
		{
			$tpl = new static($name);
		}
		elseif (TL_MODE == 'BE')
		{
			$tpl = new BackendTemplate($name);
		}
		else
		{
			$tpl = new FrontendTemplate($name);
		}

		if ($data !== null)
		{
			$tpl->setData($data);
		}

		echo $tpl->parse();
	}
public function insert($name, array $data=null)
	{
		
		if ($this instanceof Template)
		{
			$tpl = new static($name);
		}
		elseif (TL_MODE == 'BE')
		{
			$tpl = new BackendTemplate($name);
		}
		else
		{
			$tpl = new FrontendTemplate($name);
		}

		if ($data !== null)
		{
			$tpl->setData($data);
		}

		echo $tpl->parse();
	}
public function insert ( $ name , array $ data = null ) { /** @var Template $tpl */ if ( $ this instanceof Template ) { $ tpl = new static ( $ name ) ; } elseif ( TL_MODE == 'BE' ) { $ tpl = new BackendTemplate ( $ name ) ; } else { $ tpl = new FrontendTemplate ( $ name ) ; } if ( $ data !== null ) { $ tpl -> setData ( $ data ) ; } echo $ tpl -> parse ( ) ; }
Insert a template

@param string $name The template name
@param array  $data An optional data array
Insert a template