I have the following code :
public function addAction(Request $request){
$aBasket[] = $request->request->all();
$this->get('session')->set('aBasket', $aBasket);
return $this->redirect($this->generateUrl('shop_desktop_homepage'));
print_r($aBasket);
}
Works fine but is saved in session only the last array wich was save. How to put in session. For example, the array is saved like this, only the last :
array:1 [▼
0 => array:3 [▶]
]
But I want to save :
array:1 [▼
0 => array:3 [▶]
1 => array:3 [▶]
2 => array:3 [▶]
]
not only the last. Please help me!! Thx in advance.