class TwigThemeDescriptor implements ThemeDescriptorInterface, \JsonSerializable
8
{
9
/**
10
* @var string
11
*/
12
private $template;
13
14
/**
15
* @var mixed[]
16
*/
17
private $config;
18
19
/**
20
* @param string $template The Twig resource to be loaded
21
* @param mixed[] $config An array of configuration options that will be passed to the TwigTheme. Can be used to register parameters for the extensions, ... For instance, use the "theme" key to specify the theme used.
22
*/
23
public function __construct(string $template, array $config)
24
{
25
$this->template = $template;
26
$this->config = $config;
27
}
28
29
/**
30
* @return string
31
*/
32
public function getTemplate(): string
33
{
34
return $this->template;
35
}
36
37
/**
38
* @return mixed[]
39
*/
40
public function getConfig(): array
41
{
42
return $this->config;
43
}
44
45
public function jsonSerialize()
46
{
47
return [
48
'type' => 'twig',
49
'template' => $this->template,
50
'config' => $this->config,
51
];
52
}
53
54
/**
55
* Returns the path of the theme.
56
* This does not have to be an absolute path (it is relative to the theme directory)