Exemplo n.º 1
0
	public function render($tpl, $app = false, $baseFile = 'base')
	{
		$this->addTemplateDirs($this->smarty());
		if (array_key_exists($this->_renderType, $this->_contentTypes))
		{
			Header::setContentType($this->_contentTypes[$this->_renderType]);
		}
		$file = $tpl .'.'. $this->_renderType . '.tpl';
		if ($baseFile != null)
		{
			if (!preg_match('/.'.$this->_renderType.'.tpl$/', $baseFile))
			{
				$baseFile = $baseFile.'.'.$this->_renderType.'.tpl';
			}
			$this->smarty()->display('extends:'.$baseFile.'|'.$file);
		}
		else
		{
			$this->smarty()->display($file);
		}
	}
Exemplo n.º 2
0
 /**
  * @covers Rvi\Html\Layout\Header::getContentTypeAsXhtml
  */
 public function testGetContentTypeAsXhtml()
 {
     $this->object->setContentType("test - 123 & test");
     $this->assertContains("test - 123 & test", $this->object->getContentTypeAsXhtml());
 }