$session = new Zend_Session_Namespace('postfields'); $fields = $session->results; // get the previous postfields array_push($fields,$this->_request->getPost()); // add the new postfields $session->results = $fields; // assign the new postfields session_write_close();
so you get a 2 dimension array $fields[0]['accommodation_id'] $fields[0]['accommodation_name'] ... $fields[1]... Ace Paul wrote: > > I'm trying to work out how to set up an array in a session with zend > framework. > I've managed to get simple values into sessions without array, but just > can't work this part out. > > I would like to submit a form which adds the following to a session array. > > accommodation_id, accommodation_name, accommodation_price, > accommodation_type. > > I would like for people to be able to add multiple amount of these into > the session, and then loop through it on the view page, however I'm unsure > of how to add an array in a session with zend framework. > Any help would be great. thanks > ----- visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/Session-arrays-tp21365392p21373291.html Sent from the Zend Framework mailing list archive at Nabble.com.