I created a Class form, then I can access to the page form and submit it. My form use the default template of my website.
When I submitted the form, I want redirect the user to the form page (the same page) and display some elements in front of page. Theses elements depends on the results of the form has been submitted.
I can easily do that with simples drupal messages, but instead, I would like to show more complex messages.
I think I can create a little template file and include it in my form. But I haven't any ideas how can I do that in Drupal 8, can you provide me a very simple example or tell me how I can include a sub-template in my form ?
I think my sub-template looks something like this (Pseudocode, not twig :) ) :
// the form return an array
foreach formarray as element
<h1>element1<h1>
<p>property1 : {element[property1}</p>
<p>property2 : {element[property2}</p>
...
end foreach
// I include this template in the form, if the formarray is empty, nothing is displayed (when the user load the forme the first time)
Thanks for help !