1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Lit\View\Twig; |
||
6 | |||
7 | trait TwigViewBuilderTrait |
||
8 | { |
||
9 | /** |
||
10 | * @var TwigViewFactory |
||
11 | */ |
||
12 | protected $twigViewFactory; |
||
13 | |||
14 | public function injectTwigViewFactory(TwigViewFactory $twigViewFactory) |
||
15 | { |
||
16 | $this->twigViewFactory = $twigViewFactory; |
||
17 | return $this; |
||
18 | } |
||
19 | |||
20 | protected function twig(string $name) |
||
21 | { |
||
22 | return $this->attachView($this->twigViewFactory->load($name)); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
23 | } |
||
24 | } |
||
25 |