File tree 3 files changed +6
-5
lines changed
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,16 @@ Markdown content into HTML::
112
112
}
113
113
114
114
Next, create a new Twig extension and define a new filter called ``md2html ``
115
- using the ``Twig_SimpleFilter `` class. Inject the newly defined ``markdown ``
115
+ using the ``Twig\TwigFilter `` class. Inject the newly defined ``markdown ``
116
116
service in the constructor of the Twig extension::
117
117
118
118
namespace AppBundle\Twig;
119
119
120
120
use AppBundle\Utils\Markdown;
121
+ use Twig\Extension\AbstractExtension;
122
+ use Twig\TwigFilter;
121
123
122
- class AppExtension extends \Twig_Extension
124
+ class AppExtension extends AbstractExtension
123
125
{
124
126
private $parser;
125
127
@@ -131,7 +133,7 @@ service in the constructor of the Twig extension::
131
133
public function getFilters()
132
134
{
133
135
return array(
134
- new \Twig_SimpleFilter (
136
+ new TwigFilter (
135
137
'md2html',
136
138
array($this, 'markdownToHtml'),
137
139
array('is_safe' => array('html'), 'pre_escape' => 'html')
Original file line number Diff line number Diff line change @@ -183,7 +183,6 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
183
183
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
184
184
use Twig\Environment;
185
185
use Twig\Loader\FilesystemLoader;
186
- use Twig\RuntimeLoader\FactoryRuntimeLoader;
187
186
188
187
// the Twig file that holds all the default markup for rendering forms
189
188
// this file comes with TwigBridge
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ security.authorization_checker ``Symfony\Component\Security\Core\Authorization\
77
77
security.password_encoder ``Symfony\Component\Security\Core\Encoder\UserPasswordEncoder ``
78
78
session ``Symfony\Component\HttpFoundation\Session\Session ``
79
79
translator ``Symfony\Component\Translation\DataCollectorTranslator ``
80
- twig ``Twig_Environment ``
80
+ twig ``Twig\Environment ``
81
81
validator ``Symfony\Component\Validator\Validator\ValidatorInterface ``
82
82
=============================== =======================================================================
83
83
You can’t perform that action at this time.
0 commit comments