P
P
prostovlad2019-05-20 21:24:39
Template Engines
prostovlad, 2019-05-20 21:24:39

How to write from .tpl to twig?

Good afternoon. The tpl file has this script

<script>
                catFilterList = $.grep('<?php echo  preg_replace('/\s/', '',$params['filter_categslist']); ?>'.split(';'),function(n){ return n != "" });
              </script>

I rewrite it in a twig file like this
<script>
                catFilterList = $.grep('{{ preg_replace('/\s/', '', params['filter_categslist'] ) }}'.split(';'),function(n){ return n != "" });
              </script>

gives a syntax error.
Plz tell me what is the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question