当前位置: 首页>>代码示例>>PHP>>正文


PHP Support::update方法代码示例

本文整理汇总了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/');
     }
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:42,代码来源:SupportController.php


注:本文中的Support::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。