1 | <?php |
||
16 | class TwigTemplate implements HtmlElementInterface |
||
17 | { |
||
18 | |||
19 | private $environment; |
||
20 | private $template; |
||
21 | private $context; |
||
22 | |||
23 | /** |
||
24 | * @param \Twig_Environment $environment The twig environment. |
||
25 | * @param string $template The name of the twig file to be rendered. This is relative to the directory defined by the Twig_Environment (usually ROOT_PATH). |
||
26 | * @param array<string, ValueInterface>|MapValueInterface|array|object $context The context passed to the template |
||
27 | */ |
||
28 | public function __construct(\Twig_Environment $environment, $template, $context = array()) |
||
34 | |||
35 | /** |
||
36 | * Sets the context for this template. |
||
37 | * This can be anything from on array to an object to a ValueInterface... |
||
38 | * |
||
39 | * @param array<string, ValueInterface>|MapValueInterface|array|object $context |
||
40 | */ |
||
41 | public function setContext($context) |
||
45 | |||
46 | /** |
||
47 | * (non-PHPdoc) |
||
48 | * @see \Mouf\Html\HtmlElement\HtmlElementInterface::toHtml() |
||
49 | */ |
||
50 | public function toHtml() |
||
55 | |||
56 | /** |
||
57 | * Same function as toHtml() but we return Html instead of echo it |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getHtml() |
||
65 | } |
||
66 |