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


PHP AdminConfigBuilder::keyHidden方法代碼示例

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


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

示例1: addpack

 /**
  * 新增補丁
  * @author 奕瀟 <yixiao2020@qq.com>
  */
 public function addpack($title_old = '', $title = '', $sql = '', $des = '', $author = '')
 {
     if (IS_POST) {
         $aId = I('post.id', 0, 'intval');
         if ($aId != 0) {
             //編輯邏輯,取到原有數據
             $info = $this->getJsonFile($aId);
         }
         //dump($this->mPackPath . '/' . $aId . '.json');exit;
         $aTitle = I('post.title');
         $aDes = I('post.des');
         $aAuthor = I('post.author');
         $aSql = I('post.sql');
         if ($aSql == '') {
             $this->error('必須填寫Sql語句。');
         }
         $info['title'] = $aTitle;
         $info['des'] = $aDes;
         $info['author'] = $aAuthor;
         if ($aId == 0) {
             //新增邏輯
             $time = time();
             if ($title == '') {
                 $title = $time;
             }
             $info['title'] = $title;
             $fh = $this->writeSql($sql, $time);
             $info['ctime'] = time();
             $info['mtime'] = '0';
             $fh = $this->writeJsonFile($time, $info);
             $this->success("新增補丁成功。");
         } else {
             $info['mtime'] = time();
             //打開文件
             $this->writeJsonFile($aId, $info);
             fclose($fh);
             $this->writeSql($aSql, $aId);
             $this->success("編輯補丁成功。");
             exit;
         }
     } else {
         $aId = I('get.id', 0, 'intval');
         if ($aId != 0) {
             $info = $this->getJsonFile($aId);
             $info['sql'] = $this->read_file($this->pack_sql_dir . '/' . $aId . '.sql');
         }
         $formBuilder = new AdminConfigBuilder();
         $formBuilder->title('新增補丁')->keyText('title', '補丁名稱')->keyTextArea('des', '用途介紹')->keyTextArea('sql', 'sql語句')->keyText('author', '作者')->buttonSubmit();
         if ($aId != 0) {
             $info['id'] = $aId;
             $formBuilder->keyHidden('id');
         }
         $formBuilder->data($info);
         $formBuilder->display();
     }
 }
開發者ID:fishling,項目名稱:chatPro,代碼行數:60,代碼來源:UpdateController.class.php

示例2: addpack

 /**
  * 新增補丁
  * @author 奕瀟 <yixiao2020@qq.com>
  */
 public function addpack($title_old = '', $title = '', $sql = '', $des = '', $author = '')
 {
     if (IS_POST) {
         $aId = I('post.id', 0, 'intval');
         if ($aId != 0) {
             //編輯邏輯,取到原有數據
             $info = $this->getJsonFile($aId);
         }
         //dump($this->mPackPath . '/' . $aId . '.json');exit;
         $aTitle = I('post.title');
         $aDes = I('post.des');
         $aAuthor = I('post.author');
         $aSql = I('post.sql');
         if ($aSql == '') {
             $this->error(L('_SQL_STATEMENTS_MUST_BE_FILLED_OUT_'));
         }
         $info['title'] = $aTitle;
         $info['des'] = $aDes;
         $info['author'] = $aAuthor;
         if ($aId == 0) {
             //新增邏輯
             $time = time();
             if ($title == '') {
                 $title = $time;
             }
             $info['title'] = $title;
             $fh = $this->writeSql($sql, $time);
             $info['ctime'] = time();
             $info['mtime'] = '0';
             $fh = $this->writeJsonFile($time, $info);
             $this->success(L('_NEW_PATCH_SUCCESS_'));
         } else {
             $info['mtime'] = time();
             //打開文件
             $this->writeJsonFile($aId, $info);
             fclose($fh);
             $this->writeSql($aSql, $aId);
             $this->success(L('_EDIT_PATCH_SUCCESS_'));
             exit;
         }
     } else {
         $aId = I('get.id', 0, 'intval');
         if ($aId != 0) {
             $info = $this->getJsonFile($aId);
             $info['sql'] = $this->read_file($this->pack_sql_dir . '/' . $aId . '.sql');
         }
         $formBuilder = new AdminConfigBuilder();
         $formBuilder->title(L('_NEW_PATCH_'))->keyText('title', L('_PATCH_NAME_'))->keyTextArea('des', L('_INTRODUCTION_'))->keyTextArea('sql', L('_SQL_STATEMENT_'))->keyText('author', L('_AUTHOR_'))->buttonSubmit();
         if ($aId != 0) {
             $info['id'] = $aId;
             $formBuilder->keyHidden('id');
         }
         $formBuilder->data($info);
         $formBuilder->display();
     }
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:60,代碼來源:UpdateController.class.php


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