当前位置: 首页>>代码示例>>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;未经允许,请勿转载。