Send Array on multiple page Symfony 4

Send Array on multiple page Symfony 4

Hi i have an array on first page and I want to send it on multiple page.

$listIlots = $data['ilots']->getData();
return $this->redirectToRoute('multiple.interventions', ['listIlots' => $listIlots]);

Here $listIlots it’s an array but to get this value on other page it’s not working

I test 3 code

 public function intervention( Request $request ): Response
    {
        dump( $request->attributes->get('listIlots') );
        return $this->render('multipleIntervention/interventions.html.twig');
    }
 public function intervention( $listIlots ): Response
    {
        dump( $listIlots );
        return $this->render('multipleIntervention/interventions.html.twig');
    }
 public function intervention( Request $request ): Response
    {
        dump( $request->get('listIlots'));
        return $this->render('multipleIntervention/interventions.html.twig');
    }

But on all tests array don’t pass to my intervention page…
How to get my array on target page.

Thx for all help

Source: Symfony Questions

Leave a Reply

Your email address will not be published. Required fields are marked *