Answer the question
In order to leave comments, you need to log in
Ajax plus rendering on the server via symfony twig?
there is a simple search page
, only when I change the filter - in addition to the search results, one more block needs to be reloaded
{% extends "::" ~ ( app.request.isxmlhttprequest ? "ajax" : "layout" ) ~ ".html.twig" %}
{% block title %}{% endblock %}
{% block content %}
...some html
...
{% block search %}
{% for item in items %}
<div class="row">...</div>
{% endfor %}
{% endblock %}
...some other html
{% block someotherinfo %}
{% endblock %}
{% endblock %}
{% block js %}{% endblock %}
$.get('url', function(data) {
// split data to search_results and other
....
$('.search_container').html(search_results);
$('.metainfo').html(other);
} );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question