當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Model_Category::getMenu方法代碼示例

本文整理匯總了PHP中Model_Category::getMenu方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Category::getMenu方法的具體用法?PHP Model_Category::getMenu怎麽用?PHP Model_Category::getMenu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Model_Category的用法示例。


在下文中一共展示了Model_Category::getMenu方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addAction

 /**
  * 增加商品
  *
  * @return boolean
  */
 public function addAction()
 {
     if ($this->isPost()) {
         $aData = $this->_checkData(1);
         if (empty($aData)) {
             return null;
         }
         $aData['iPublishStatus'] = 0;
         //發布需要將該字段改為1
         //增加需要加上當前添加人ID
         $aCurrUserInfo = $this->aCurrUser;
         $aData['iUpdateUserID'] = $aData['iCreateUserID'] = $aCurrUserInfo['iUserID'];
         $iGoodsID = Model_Goods::addData($aData);
         if ($iGoodsID > 0) {
             return $this->showMsg('商品添加成功!', true);
         } else {
             return $this->showMsg('商品添加失敗!', false);
         }
     } else {
         $this->_response->setHeader('Access-Control-Allow-Origin', '*.*');
         $aTree = Model_Category::getMenu();
         $this->assign('aTree', $aTree);
         $this->assign('aUnlockType', $this->aUnlockType);
         $this->assign('aUnlockLevel', $this->aUnlockLevel);
         $this->assign('sUploadUrl', Yaf_G::getConf('upload', 'url'));
         $this->assign('sFileBaseUrl', 'http://' . Yaf_G::getConf('file', 'domain'));
     }
 }
開發者ID:nicevoice,項目名稱:yhtx,代碼行數:33,代碼來源:Index.php

示例2: editAction

 public function editAction()
 {
     $aParam['iID'] = intval($this->getParam('id'));
     $aParam['iID1'] = intval($this->getParam('iID'));
     $aParam['sName'] = $this->getParam('sName');
     $aParam['iParentID'] = intval($this->getParam('iParentID'));
     if ($this->isPost()) {
         if ($aParam['iID'] != $aParam['iID1']) {
             $this->showMsg('非法操作', false);
         }
         unset($aParam['iID1']);
         $aParam['iUpdateUser'] = $this->aCurrUser['iUserID'];
         $aCategory = $this->_checkData($aParam);
         if (empty($aCategory)) {
             return null;
         }
         $aData = Model_Category::exsistCategory($aParam['sName'], $aParam['iParentID']);
         if (!empty($aData)) {
             return $this->showMsg('已存在該分類', false);
         }
         if (Model_Category::updData($aCategory)) {
             return $this->showMsg('分類修改成功', true);
         }
     } else {
         $aCategory = Model_Category::getDetail($aParam['iID']);
         if (empty($aCategory)) {
             $this->showMsg('該分類不存在', false);
         }
         $aData = Model_Category::getMenu();
         $this->assign('aCategory', $aCategory);
         $this->assign('aTree', $aData);
     }
 }
開發者ID:nicevoice,項目名稱:yhtx,代碼行數:33,代碼來源:Category.php


注:本文中的Model_Category::getMenu方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。