| 1 | <?php |
||
| 9 | class TemplateEngineFactory |
||
| 10 | { |
||
| 11 | const SMARTY_ENGINE = 'smarty'; |
||
| 12 | const TWIG_ENGINE = 'twig'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var ContainerInterface |
||
| 16 | */ |
||
| 17 | private $container; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $templateEngine; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * TemplateEngineFactory constructor. |
||
| 26 | * |
||
| 27 | * @param ContainerInterface $container |
||
| 28 | * @param string $templateEngine |
||
| 29 | */ |
||
| 30 | public function __construct(ContainerInterface $container, string $templateEngine) { |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param $type |
||
| 37 | * |
||
| 38 | * @return mixed |
||
| 39 | * |
||
| 40 | * @throws UnknownEngineException |
||
| 41 | */ |
||
| 42 | public function getByType($type) : TemplateEngine { |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return TemplateEngine |
||
| 55 | */ |
||
| 56 | public function getDefault() : TemplateEngine { |
||
| 59 | |||
| 60 | } |
||
| 61 |