本文整理汇总了PHP中Support::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::update方法的具体用法?PHP Support::update怎么用?PHP Support::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Support
的用法示例。
在下文中一共展示了Support::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
public function editAction()
{
if ($this->tplVars['lvals']['canEdit'] && $this->_hasParam('id')) {
include_once 'support.php';
$id = $this->_getParam('id');
$this->tplVars['lvals']['postRes'] = 2;
$support = new Support();
$this->tplVars['support'] = $support->getById($id);
if ($this->_request->getPost('ispost')) {
$this->tplVars['platforms'] = $this->_request->getPost();
if (($this->tplVars['lvals']['postRes'] = $support->update($id, $this->_request->getPost())) > 0) {
$this->_redirect('support/');
}
$select_prods = $this->_request->getPost('products_support');
foreach ($select_prods as $val) {
$select[$val] = $val;
}
} else {
$select_prods = $support->selectSuportProd($id);
foreach ($select_prods as $val) {
$select[$val['ps_product_id']] = $val;
}
}
$products = new AdminProducts();
$prods = $products->getProducts();
foreach ($prods['prods'] as $cat => $prod) {
foreach ($prod as $key => $val) {
$prods['prods'][$cat][$key]['select'] = $select[$key] ? 1 : 0;
}
}
$this->tplVars['products'] = $prods;
array_push($this->tplVars['page_css'], 'product_edit.css');
array_push($this->tplVars['page_css'], 'livevalidation.css');
array_push($this->tplVars['page_js'], 'livevalidation.js');
$this->tplVars['lvals']['isNewRecord'] = false;
$this->tplVars['header']['actions']['names'][] = array('name' => 'supportedit', 'menu_name' => 'Support Edit');
array_push($this->viewIncludes, 'support/Edit.tpl');
unset($os);
} else {
$this->_redirect('support/');
}
}