【发布时间】:2014-01-08 19:21:56
【问题描述】:
您如何在与zend 的会话中添加产品?我以数组的形式接收产品
我试试这个,但是不行
a 以及你如何在另一个动作中进行此会话...
非常感谢
public function incartAction(){
$this->_helper->_layout->disableLayout();
$id = $this->_getParam("id");
$name= $this->_getParam("name");
$price= $this->getParam("price");
$img = $this->_getParam("img");
$qty = $this->_getParam("qty");
$produs = array(
"id"=>$id,
"name"=>$name,
"price"=>$price,
"img"=>$img,
"qty"=>$qty
);
$produs_model = new Application_Model_DbTable_Produs;
$produs_model->updateProdusById($id, $qty);
$cart = new Zend_Session_Namespace("products");
$cart->products->$name= $product;
$this->view->assign("cart", $cart);
}
【问题讨论】:
标签: php session zend-framework namespaces