<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # addRightButton 用來在頁面數據列表右側的操作欄位置添加一個按鈕 ## 方法原型 function addRightButton($type, $attribute = null){} ## 參數: | 參數 | 類型 | 是否必須 | 說明 | | ------------ | ------------ | ------------ | ------------ | | $type | string | 是 | 按鈕類型,edit/forbid/recycle/restore/delete/self六種取值 | | $attribute | array | 否 | 按鈕屬性,一個定了標題/鏈接/CSS類名等的屬性描述數組 | $attribute格式如下 $attr['name'] = 'edit2'; $attr['title'] = '編輯2'; $attr['class'] = 'label label-primary'; $attr['href'] = U('edit', array('id' => '__data_id__')); ## 預定義按鈕 >為了大家使用更加方便,我們事先預定義了幾種經常用到的按鈕 主要有edit/forbid/recycle/restore/delete五種預定義按鈕 其中forbid/recycle/restore/delete這4種類型有一個使用前提,那就是對應的數據表必須要有一個`status`字段 status:-1 刪除狀態 status:0 禁用狀態 status:1 正常狀態 使用示例: ```php // 使用Builder快速建立列表頁面。 $builder = new \Common\Builder\ListBuilder(); $builder->setMetaTitle('文章列表') ->addRightButton('edit') // 編輯按鈕 ->addRightButton('forbid') // 禁用按鈕/啟用按鈕(根據status自動判斷) ->addRightButton('recycle') // 回收按鈕(status從1到-1) ->addRightButton('restore') // 恢復按鈕(status從-1到1) ->addRightButton('delete'); // 刪除按鈕(刪了就找不回了) ``` ## 自定義按鈕 > 第一原則使用上面的預定義按鈕,如果有特殊需求不能滿足則使用此自定義按鈕方法。 第一步:自定義按鈕時首先需要給函數的第一個參數傳值為`self`,只有設置了self才表示即將添加一個自定義按鈕 第二步:定義一個數組類似array('title'=>'按鈕名稱', href='按鈕鏈接', 'class'=>'按鈕CSS類名'),然后把數組傳給此函數的第二個參數 ### 注意: > 因為右側按鈕是針對某條記錄的,所以ID是經常要用到的,比如編輯按鈕。 這里因為在Listbuilder運行渲染頁面是無法得到具體ID的,所以ListBuilder內置了__data_id__來作為替換變量,只要在鏈接里有會在數據foreach遍歷階段被替換成真實的ID 示例: ```php $attr['name'] = 'edit2'; $attr['title'] = '編輯2'; $attr['class'] = 'label label-primary'; $attr['href'] = U('edit', array('id' => '__data_id__')); // 使用Builder快速建立列表頁面。 $builder = new \Common\Builder\ListBuilder(); $builder->setMetaTitle('文章列表') ->addRightButton('edit'); ->addRightButton('self', $attr); ``` >細心的人可能會發現->addRightButton('self', $attr)其實作用跟->addRightButton('edit')是一樣的作用,只不過后者是預定義好的,比前者使用方便。
                  <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>

                              哎呀哎呀视频在线观看