Completed
Push — master ( 33f856...2c02d9 )
by Aimeos
10:22
created

Blade::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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
 * Blade view engine implementation
16
 *
17
 * @package MW
18
 * @subpackage View
19
 */
20
class Blade implements Iface
21
{
22
	private $factory;
23
24
25
	/**
26
	 * Initializes the view object
27
	 *
28
	 * @param \Illuminate\View\Factory $factory Laravel view factory
29
	 */
30
	public function __construct( \Illuminate\View\Factory $factory )
31
	{
32
		$this->factory = $factory;
33
	}
34
35
36
	/**
37
	 * Renders the output based on the given template file name and the key/value pairs
38
	 *
39
	 * @param string $filename File name of the view template
40
	 * @param array $values Associative list of key/value pairs
41
	 * @return string Output generated by the template
42
	 * @throws \Aimeos\MW\View\Exception If the template isn't found
43
	 */
44
	public function render( $filename, array $values )
45
	{
46
		return $this->factory->file( $filename, $values )->render();
47
	}
48
}
49