ajaxsymfonysymfony-2.5

Symfony 2.5 - How to catch informations from a page to show it into an other page?


I'm really new in Symfony and AJAX and i hope you can explain me how should I do :

enter image description here I have several elements in Page A, each of them corresponding to elements in several Pages B(1,2,3).

I want to catch elements from a specific Page like B2 and to show it in Page A with the matching element in Array AJAX.

A route already exists in Routing.yml for Folder Controller:

bundle_test:
resource: "@Bundle/Controller"
type: annotation
prefix: /

I have to create specifics routes ? How should i do ? Thx.


Solution

  • In Page A, put this code

    {% include 'twig from Pages B' with {'xxx': test, ...} %}
    

    You can customize this code with yours. You can replace test with any variables from Page A. As for xxx, replace it with the variables from Pages B.