1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2016 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic |
||
6 | * |
||
7 | * @link http://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\CoreBundle\Helper; |
||
13 | |||
14 | use Mautic\CoreBundle\Templating\TemplateNameParser; |
||
15 | use Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine; |
||
16 | use Symfony\Component\DependencyInjection\Container; |
||
17 | use Symfony\Component\HttpKernel\Kernel; |
||
18 | |||
19 | class TemplatingHelper |
||
20 | { |
||
21 | /** |
||
22 | * @var Container |
||
23 | */ |
||
24 | protected $container; |
||
25 | |||
26 | public function __construct(Kernel $kernel) |
||
27 | { |
||
28 | $this->container = $kernel->getContainer(); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Retrieve the templating service. |
||
33 | * |
||
34 | * @return DelegatingEngine |
||
35 | * |
||
36 | * @throws \Exception |
||
37 | */ |
||
38 | public function getTemplating() |
||
39 | { |
||
40 | return $this->container->get('templating'); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return TemplateNameParser |
||
45 | */ |
||
46 | public function getTemplateNameParser() |
||
47 | { |
||
48 | return new TemplateNameParser($this->container->get('kernel')); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
49 | } |
||
50 | } |
||
51 |