PHP code example of quansitech / qscmf-builderitem-checkbox-text

1. Go to this page and download the library: Download quansitech/qscmf-builderitem-checkbox-text library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

quansitech / qscmf-builderitem-checkbox-text example snippets


composer 

  // title: 选项标题
  // key: 选现对应的键值
  // need_text 是否需要填写额外的文本项
  $option = [
    [
        'title' => '网站开发',
        'key' => 1,
    ],
    [
        'title' => '公众号运维',
        'key' => 2,
    ],
    [
        'title' => '其他',
        'key' => 3,
        'need_text' => true,
    ]
  ];
  ->addFormItem("main_business", "checkbox_text", "主营业务", "", $option)
  
  //注意:组件会自动构造好json格式的数据提交,直接存入对应的数据库字段即可
  

    $option = [
        [
            'title' => '网站开发',
            'key' => 1,
        ],
        [
            'title' => '公众号运维',
            'key' => 2,
        ],
        [
            'title' => '其他',
            'key' => 3,
            'need_text' => true,
        ]
    ];
  ->addTableColumn("main_business", "主营业务", "checkbox_text", $option)