<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                **setExtraItems ($extra_items)** 這個方法與addFormItem是一個系列的,此方法用于批量添加已經提前按規范構造好的數組來添加表單項目(具體格式可以參考第三方登錄插件的config.php),比如后臺的插件配置就是實用此方法,為什么要使用此方法,因為像后臺插件這種,每個插件的配置字段都是不一樣的,都存儲在數據庫里或者文件系統里,所以你沒辦法用addFormItem去一個個去添加,只能用setExtraItems這種辦法一次性把數據傳遞給FormBuilder,這種辦法不但支持一維TAB還支持多TAB表單,與SetTabNav實際不一樣,這個TAB是在同一個頁面里的切換,而SetTabNav實際上是一個鏈接跳轉了而已。 > 當然了setExtraItems和addFormItem是支持一起同時使用的。 **參數** @param $extra_items 標單項數組(格式可以第三方登錄插件的config.php) 類似下面這樣: ~~~ array( 'title'=>'開啟同步登錄:', 'type'=>'checkbox', 'options'=>array( 'Weixin'=>'微信', 'Qq'=>'QQ', 'Sina'=>'新浪', 'Renren'=>'人人', 'Github'=>'Github', ), ), 'meta'=>array( 'title'=>'接口驗證代碼:', 'type'=>'textarea', 'value'=>'', 'tip'=>'需要在Meta標簽中寫入驗證信息時,拷貝代碼到這里。' ), 'group'=>array( 'type'=>'group', 'options'=>array( 'Wexin'=>array( 'title'=>'微信配置', 'options'=>array( 'WeixinKey'=>array( 'title'=>'微信APPKEY:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://open.weixin.qq.com/', ), 'WeixinSecret'=>array( 'title'=>'微信APPSECRET:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://open.weixin.qq.com/', ) ) ), 'Qq'=>array( 'title'=>'QQ配置', 'options'=>array( 'QqKey'=>array( 'title'=>'QQ互聯APPKEY:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://connect.qq.com', ), 'QqSecret'=>array( 'title'=>'QQ互聯APPSECRET:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://connect.qq.com', ) ), ), 'Sina'=>array( 'title'=>'新浪配置', 'options'=>array( 'SinaKey'=>array( 'title'=>'新浪APPKEY:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://open.weibo.com/', ), 'SinaSecret'=>array( 'title'=>'新浪APPSECRET:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://open.weibo.com/', ) ), ), 'Renren'=>array( 'title'=>'人人配置', 'options'=>array( 'RenrenKey'=>array( 'title'=>'人人APPKEY:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://dev.renren.com/', ), 'RenrenSecret'=>array( 'title'=>'人人APPSECRET:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:http://dev.renren.com/', ) ) ), 'Github'=>array( 'title'=>'Github配置', 'options'=>array( 'GithubKey'=>array( 'title'=>'GithubAPPKEY:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:https://github.com/settings/applications', ), 'GithubSecret'=>array( 'title'=>'GithubAPPSECRET:', 'type'=>'text', 'value'=>'', 'tip'=>'申請地址:https://github.com/settings/applications', ) ) ) ) ) ); ~~~ **用法示例** ~~~ $db_config = $addon['config']; $addon['config'] = include $data->config_file; if ($db_config) { $db_config = json_decode($db_config, true); foreach ($addon['config'] as $key => $value) { if ($value['type'] != 'group') { $addon['config'][$key]['value'] = $db_config[$key]; } else { foreach ($value['options'] as $gourp => $options) { foreach ($options['options'] as $gkey => $value) { $addon['config'][$key]['options'][$gourp]['options'][$gkey]['value'] = $db_config[$gkey]; } } } } } // 構造表單名 foreach ($addon['config'] as $key => $val) { if ($val['type'] == 'group') { foreach ($val['options'] as $key2 => $val2) { foreach ($val2['options'] as $key3 => $val3) { $addon['config'][$key]['options'][$key2]['options'][$key3]['name'] = 'config['.$key3.']'; } } } else { $addon['config'][$key]['name'] = 'config['.$key.']'; } } $this->assign('data', $addon); $this->assign('form_items', $addon['config']); if ($addon['custom_config']) { $this->assign('custom_config', $this->fetch($addon['addon_path'].$addon['custom_config'])); $this->display($addon['addon_path'].$addon['custom_config']); } else { //使用FormBuilder快速建立表單頁面。 $builder = new \Common\Builder\FormBuilder(); $builder->setMetaTitle('插件設置') //設置頁面標題 ->setPostUrl(U('config')) //設置表單提交地址 ->addFormItem('id', 'hidden', 'ID', 'ID') ->setExtraItems($addon['config']) //直接設置表單數據 ->setFormData($addon) ->display(); } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看