|
3 | 3 | namespace Limenius\ReactRenderer\Twig; |
4 | 4 |
|
5 | 5 | use Psr\Cache\CacheItemPoolInterface; |
| 6 | +use Twig\Extension\AbstractExtension; |
| 7 | +use Twig\TwigFunction; |
6 | 8 | use Limenius\ReactRenderer\Renderer\AbstractReactRenderer; |
7 | 9 | use Limenius\ReactRenderer\Context\ContextProviderInterface; |
8 | 10 |
|
9 | | -class ReactRenderExtension extends \Twig_Extension |
| 11 | +class ReactRenderExtension extends AbstractExtension |
10 | 12 | { |
11 | 13 | protected $renderServerSide = false; |
12 | 14 | protected $renderClientSide = false; |
@@ -51,10 +53,10 @@ public function setCache(CacheItemPoolInterface $cache) |
51 | 53 | public function getFunctions(): array |
52 | 54 | { |
53 | 55 | return array( |
54 | | - new \Twig_SimpleFunction('react_component', array($this, 'reactRenderComponent'), array('is_safe' => array('html'))), |
55 | | - new \Twig_SimpleFunction('react_component_array', array($this, 'reactRenderComponentArray'), array('is_safe' => array('html'))), |
56 | | - new \Twig_SimpleFunction('redux_store', array($this, 'reactReduxStore'), array('is_safe' => array('html'))), |
57 | | - new \Twig_SimpleFunction('react_flush_buffer', array($this, 'reactFlushBuffer'), array('is_safe' => array('html'))), |
| 56 | + new TwigFunction('react_component', array($this, 'reactRenderComponent'), array('is_safe' => array('html'))), |
| 57 | + new TwigFunction('react_component_array', array($this, 'reactRenderComponentArray'), array('is_safe' => array('html'))), |
| 58 | + new TwigFunction('redux_store', array($this, 'reactReduxStore'), array('is_safe' => array('html'))), |
| 59 | + new TwigFunction('react_flush_buffer', array($this, 'reactFlushBuffer'), array('is_safe' => array('html'))), |
58 | 60 | ); |
59 | 61 | } |
60 | 62 |
|
|
0 commit comments