Completed
Push — master ( cc06f9...4fbb13 )
by Aimeos
10:31
created

Flow   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A render() 0 10 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017
6
 * @package MW
7
 * @subpackage View
8
 */
9
10
11
namespace Aimeos\MW\View\Engine;
12
13
14
/**
15
 * Flow view engine implementation
16
 *
17
 * @package MW
18
 * @subpackage View
19
 */
20
class Flow implements Iface
21
{
22
	private $view;
23
24
25
	/**
26
	 * Initializes the view object
27
	 *
28
	 * @param \TYPO3\Fluid\View\StandaloneView $view Flow template view object
29
	 */
30
	public function __construct( \TYPO3\Fluid\View\StandaloneView $view )
31
	{
32
		$this->view = $view;
33
	}
34
35
36
	/**
37
	 * Renders the output based on the given template file name and the key/value pairs
38
	 *
39
	 * @param \Aimeos\MW\View\Iface $view View object
40
	 * @param string $filename File name of the view template
41
	 * @param array $values Associative list of key/value pairs
42
	 * @return string Output generated by the template
43
	 * @throws \Aimeos\MW\View\Exception If the template isn't found
44
	 */
45
	public function render( \Aimeos\MW\View\Iface $view, $filename, array $values )
46
	{
47
		$fluid = clone $this->view;
48
49
		$fluid->setTemplatePathAndFilename( $filename );
50
		$fluid->assign( '_aimeos_view', $view );
51
		$fluid->assignMultiple( $values );
52
53
		return $fluid->render();
54
	}
55
}
56