File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 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::
112112 }
113113
114114Next, 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 ``
116116service in the constructor of the Twig extension::
117117
118118 namespace AppBundle\Twig;
119119
120120 use AppBundle\Utils\Markdown;
121+ use Twig\Extension\AbstractExtension;
122+ use Twig\TwigFilter;
121123
122- class AppExtension extends \Twig_Extension
124+ class AppExtension extends AbstractExtension
123125 {
124126 private $parser;
125127
@@ -131,7 +133,7 @@ service in the constructor of the Twig extension::
131133 public function getFilters()
132134 {
133135 return array(
134- new \Twig_SimpleFilter (
136+ new TwigFilter (
135137 'md2html',
136138 array($this, 'markdownToHtml'),
137139 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
183183 use Symfony\Bridge\Twig\Form\TwigRendererEngine;
184184 use Twig\Environment;
185185 use Twig\Loader\FilesystemLoader;
186- use Twig\RuntimeLoader\FactoryRuntimeLoader;
187186
188187 // the Twig file that holds all the default markup for rendering forms
189188 // 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\
7777security.password_encoder ``Symfony\Component\Security\Core\Encoder\UserPasswordEncoder ``
7878session ``Symfony\Component\HttpFoundation\Session\Session ``
7979translator ``Symfony\Component\Translation\DataCollectorTranslator ``
80- twig ``Twig_Environment ``
80+ twig ``Twig\Environment ``
8181validator ``Symfony\Component\Validator\Validator\ValidatorInterface ``
8282=============================== =======================================================================
8383
You can’t perform that action at this time.
0 commit comments