File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -102,14 +102,16 @@ Markdown content into HTML::
102
102
}
103
103
104
104
Next, create a new Twig extension and define a new filter called ``md2html ``
105
- using the ``Twig_SimpleFilter `` class. Inject the newly defined ``Markdown ``
105
+ using the ``Twig\TwigFilter `` class. Inject the newly defined ``Markdown ``
106
106
class in the constructor of the Twig extension::
107
107
108
108
namespace AppBundle\Twig;
109
109
110
110
use AppBundle\Utils\Markdown;
111
+ use Twig\Extension\AbstractExtension;
112
+ use Twig\TwigFilter;
111
113
112
- class AppExtension extends \Twig_Extension
114
+ class AppExtension extends AbstractExtension
113
115
{
114
116
private $parser;
115
117
@@ -121,7 +123,7 @@ class in the constructor of the Twig extension::
121
123
public function getFilters()
122
124
{
123
125
return array(
124
- new \Twig_SimpleFilter (
126
+ new TwigFilter (
125
127
'md2html',
126
128
array($this, 'markdownToHtml'),
127
129
array('is_safe' => array('html'), 'pre_escape' => 'html')
You can’t perform that action at this time.
0 commit comments