Completed
Push — develop ( 18ce4b...3c36de )
by Daniel
11:04
created

template::render_view()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\sitemaker\services;
11
12
use phpbb\template\twig\twig;
13
14
class template extends twig
15
{
16
	/**
17
	 * Clear template data
18
	 */
19
	public function clear()
20
	{
21
		$this->context->clear();
22
	}
23
24
	/**
25
	 * Render Template View
26
	 *
27
	 * @param string $ext_name extension name in form namespace/extension
28
	 * @param string $tpl_file html template file
29
	 * @param string $handle template handle
30
	 * @return string
31
	 */
32
	public function render_view($ext_name, $tpl_file, $handle)
33
	{
34
		$this->set_style(array("ext/$ext_name/styles", 'styles'));
35
36
		$this->set_filenames(array(
37
			$handle	=> $tpl_file)
38
		);
39
40
		$view = $this->assign_display($handle);
41
		$this->context->clear();
42
43
		return $view;
44
	}
45
}
46