D
D
D44k2016-01-25 12:59:42
Twig
D44k, 2016-01-25 12:59:42

Your own Twig filter?

You need to add your own filter for twig on laravel.
According to the official manual twig.sensiolabs.org/doc/advanced.html this is not difficult to do.

$filter = new Twig_SimpleFilter('md5', 'md5');
$twig = new Twig_Environment($loader);
$twig->addFilter($filter);

Explain what is $loader in this case, and if I can add a filter globally, and not call it through a script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Romanenko, 2016-01-31
@slimus

Didn't work with laravel but here they write that everything is simple: stackoverflow.com/questions/16415778/how-to-use-cu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question