forked from TerrePorter/StringBladeCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactory.php
More file actions
54 lines (46 loc) · 1.4 KB
/
Copy pathFactory.php
File metadata and controls
54 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Wpb\String_Blade_Compiler;
use InvalidArgumentException;
use Illuminate\View\Factory as BaseFactory;
/**
* Class Factory
*
* Updated View\Factory class for StringBladeCompiler.
*/
class Factory extends BaseFactory
{
/**
* Get the evaluated view contents for the given view.
*
* @param string $view
* @param array $data
* @param array $mergeData
* @return \Illuminate\Contracts\View\View
*/
public function make($view, $data = [], $mergeData = [])
{
if (is_array($view)) {
//$cache = config('view.compiled');
//$compiler = new StringBladeCompiler(app('files'), $cache);
//$engine = new CompilerEngine($compiler);
$engine = $this->engines->resolve('stringblade');
$data = array_merge($mergeData, $this->parseData($data));
$this->callCreator($view = new StringView($this, $engine, $view, 'not-used', $data));
} else {
$view = parent::make($view, $data, $mergeData);
}
return $view;
}
/**
* Get the appropriate view engine for the given string key.
*
* @param string $stringkey
* @return \Illuminate\View\Engines\EngineInterface
*
* @throws \InvalidArgumentException
*/
public function getEngineFromStringKey($stringkey)
{
return $this->engines->resolve($stringkey);
}
}