本文整理汇总了PHP中Support::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::add方法的具体用法?PHP Support::add怎么用?PHP Support::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Support
的用法示例。
在下文中一共展示了Support::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
if ($this->tplVars['lvals']['canEdit']) {
include_once 'support.php';
if ($this->_request->getPost('ispost')) {
$support = new Support();
$this->tplVars['support'] = $this->_request->getPost();
if (($this->tplVars['lvals']['postRes'] = $support->add($this->_request->getPost())) > 0) {
$this->_redirect('support/');
}
$select_prods = $this->_request->getPost('products_support');
foreach ($select_prods as $val) {
$select[$val] = $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'] = true;
array_push($this->viewIncludes, 'support/Edit.tpl');
$this->tplVars['lvals']['postRes'] = 2;
unset($support);
} else {
$this->_redirect('support/');
}
}