K
K
kursof2016-10-09 20:14:12
PHP
kursof, 2016-10-09 20:14:12

How to do it under smarty php?

when inserted into the site, it destroys the site like glass.
how to display in Smarty?

<script type="text/javascript">
    var config = {
      '.chosen-select'           : {},
      '.chosen-select-deselect'  : {allow_single_deselect:true},
      '.chosen-select-no-single' : {disable_search_threshold:10},
      '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
      '.chosen-select-width'     : {width:"95%"}
    }
    for (var selector in config) {
      $(selector).chosen(config[selector]);
    }
  </script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2016-10-09
@kursof

Curly braces break the interpreter. The Smarty syntax is built on them.
There are two solutions:
PS: In general, it's better to stop poking around in poo. Two girls - one Smarty. Low-performance, abandoned template engine with vague areas of responsibility.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question