| 1 | <?php namespace Tarsana\Command\Template\Twig; |
||
| 5 | class TwigTemplate implements TemplateInterface { |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Twig template instance. |
||
| 9 | */ |
||
| 10 | protected $twig; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Data to pass to the template. |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $data; |
||
| 18 | |||
| 19 | public function __construct ($twig) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Binds data to the template. |
||
| 27 | * |
||
| 28 | * @param array $data |
||
| 29 | * @return self |
||
| 30 | */ |
||
| 31 | public function bind (array $data) : TemplateInterface |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Renders the template. |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function render(array $data = null) : string |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Clears the data. |
||
| 52 | * |
||
| 53 | * @return self |
||
| 54 | */ |
||
| 55 | public function clean () : TemplateInterface |
||
| 60 | } |
||
| 61 |