hi in view creating 2 dimentional array in javascript , passting update controller follows :
array in javascript
item[0][0] = null; item[0][1] = 1; item[1][0] = 2; item[1][0] = 3; alert (item); show ,1,2,3
passing zend controller :
$.ajax({ type: "post", url: "admin/navigation/update", data: item, success: function(data) { alert(data); }, error: function() { alert("failure"); } }); return false; } how can receive update controller , assign php array as
public function updateaction() { $data = $this->_request->getpost(); //code should come here array( item1( array( value1 = item[0][0] //from javascript array value2 = item[0][1] ) ) item2( array( value1 = item[1][0] value2 = item[1][0] ) ) ) } i'm n00b in zend , appriciated :)
instead of below code:
$data = $this->_request->getpost(); use following code:
$data = $this->_request->getparams(); print_r($data); this give array sending javascript.
Comments
Post a Comment